- Reorganized settings management
- Added localisation UI - Added Greek localisation - Message text refactoring FossilOrigin-Name: 05f2cac387c4a3863197f794c68421f7e04fb28e
This commit is contained in:
1223
intl/el_GR.po
Normal file
1223
intl/el_GR.po
Normal file
File diff suppressed because it is too large
Load Diff
1199
intl/en_US.pot
Normal file
1199
intl/en_US.pot
Normal file
File diff suppressed because it is too large
Load Diff
14
intl/update.sh
Executable file
14
intl/update.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
# Regenerate the the reference pot
|
||||
lupdate ../fuel.pro -ts en_US.ts -source-language en.US -target-language en.US
|
||||
lconvert en_US.ts -o en_US.pot
|
||||
|
||||
# Merge reference pot file with all languages
|
||||
# Requires the gettext tool msgmerge
|
||||
for i in *.po
|
||||
do
|
||||
echo "Merging $i"
|
||||
msgmerge --update $i en_US.pot
|
||||
done
|
||||
|
||||
|
25
manifest
25
manifest
@ -1,5 +1,5 @@
|
||||
C Initial\ssupport\sfor\slocalization
|
||||
D 2012-09-23T10:20:57.755
|
||||
C -\sReorganized\ssettings\smanagement\n-\sAdded\slocalisation\sUI\n-\sAdded\sGreek\slocalisation\n-\sMessage\stext\srefactoring\n
|
||||
D 2012-10-08T11:28:08.233
|
||||
F dist/arch/PKGBUILD dd21073c035af4e6a4ecb3842c1fd7ae45c5e93d
|
||||
F dist/win/fuel.iss ef3558dbba409eb194938b930377fc9ee27d319e
|
||||
F doc/Building.txt 7c0f1060d4a08ed330058d4a3a68905c05228381
|
||||
@ -7,6 +7,9 @@ F doc/Changes.txt e21c9355aaeb7643c8d6784effd2f9ebadf3a8e0
|
||||
F doc/License.txt 4cc77b90af91e615a64ae04893fdffa7939db84c
|
||||
F fuel.pro f9053752c0ea40a7f9c90ac738a6c1689b92dfe5
|
||||
F intl/convert.sh 6dfabd9c78df20b2c5c767b301cc4cd8813f442d x
|
||||
F intl/el_GR.po 3e5e6ce253260b706d2867eb5a173910a4592945
|
||||
F intl/en_US.pot bcc376ed49e645b8722f3dd18e45a229de4709bc
|
||||
F intl/update.sh 321b3012ea5129e9ea32e52df4f1de509e974882 x
|
||||
F rsrc/fuel.desktop 43145556bc61f5a91b497c38a16aec44af271d29
|
||||
F rsrc/fuel.rc 8e9ac966f283102c11a77cd7f936cdc09e09bd79
|
||||
F rsrc/icons/Address\sBook-01.png ef2cec80ea5a559b72e8be4a344a1869fe69cbd8
|
||||
@ -164,7 +167,7 @@ F rsrc/icons/Zoom-01.png 67ca532922e9166325c5c75fce1ca3fbb0d2b6a6
|
||||
F rsrc/icons/fuel.icns 81e535004b62db801a02f3e15d0a33afc9d4070b
|
||||
F rsrc/icons/fuel.ico eb529ab3332a17b9302ef3e851db5b9ebce2a038
|
||||
F rsrc/icons/fuel.png 40daf53b7f6bdcdd0d6aa5ef433d078ec5ea4342
|
||||
F rsrc/resources.qrc e98383ed205f4e37100c60057e0129c3b86dea53
|
||||
F rsrc/resources.qrc 02f23809e7e24747d391f97de3a92518c3393410
|
||||
F src/CloneDialog.cpp 85bc6473d1e3a47d0f981e96357a376be63ab0bc
|
||||
F src/CloneDialog.h 1c63da4346ca20b67d52016b7b64875b9c5b477f
|
||||
F src/CommitDialog.cpp c62ce7fb234e43ca8641c16522c750e6419bf947
|
||||
@ -175,10 +178,10 @@ F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
||||
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||
F src/MainWindow.cpp 026cb929ead96dd5885be7ff14190c7ff8d033d5
|
||||
F src/MainWindow.h 7839457d09848b40beb03e36ddc4f755d8631881
|
||||
F src/SettingsDialog.cpp 824ab2445df35aec131e0c1d891c96f660c1bb28
|
||||
F src/SettingsDialog.h 09d3f375b2fab59248fae9bd12419f2985720d28
|
||||
F src/MainWindow.cpp f25ef475c51053c08aa786766fac68b50d652958
|
||||
F src/MainWindow.h 3f3825cab25058666b6706b36f51269ad5f65f3e
|
||||
F src/SettingsDialog.cpp 38ad760300955de5cce15d83702e1237ea3148a1
|
||||
F src/SettingsDialog.h 528e77b6e262a020e02df78017387e498abb453e
|
||||
F src/Utils.cpp caca5268e3194abe77211040bf9511a82909d2e6
|
||||
F src/Utils.h 5af911147390879176e587fc60fb662490bb9e97
|
||||
F src/main.cpp fcd78f44b893fb9c93bbb71a2e861bd36af95f88
|
||||
@ -187,8 +190,8 @@ F ui/CloneDialog.ui 0fc820804df91f16506ee466a44519fdd44e468f
|
||||
F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f
|
||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||
F ui/MainWindow.ui 6ad583b6d864ccbeac8e3fd1d05cd964bc17c5f9
|
||||
F ui/SettingsDialog.ui cd6faff19c1a6c2640193eb5a258f0daa926a2cf
|
||||
P 1760813f6ce3ed23ab45bee2fbde8cbf487d2481
|
||||
R 12e9a8ebc31d18b45a1d208db05caf62
|
||||
F ui/SettingsDialog.ui 7cc01b1a63c59258ee4865022108852b5126db52
|
||||
P 8d881de4e52069221dd6ae38a436449fbccdac25
|
||||
R 7f1d11773b50d22aa625c653cc91f018
|
||||
U kostas
|
||||
Z 63bee23b106d51238aa4d200b0a7da88
|
||||
Z 67ce7969d95085d2e0a274986395168f
|
||||
|
@ -1 +1 @@
|
||||
8d881de4e52069221dd6ae38a436449fbccdac25
|
||||
05f2cac387c4a3863197f794c68421f7e04fb28e
|
@ -152,4 +152,7 @@
|
||||
<file>icons/Zoom In-01.png</file>
|
||||
<file>icons/Zoom Out-01.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/intl">
|
||||
<file>intl/el_GR.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -198,7 +198,7 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
|
||||
viewMode = VIEWMODE_TREE;
|
||||
|
||||
loadSettings();
|
||||
applySettings();
|
||||
|
||||
// Apply any explicit workspace path if available
|
||||
if(workspacePath && !workspacePath->isEmpty())
|
||||
@ -217,7 +217,7 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
stopUI();
|
||||
saveSettings();
|
||||
updateSettings();
|
||||
|
||||
// Dispose RepoFiles
|
||||
for(filemap_t::iterator it = workspaceFiles.begin(); it!=workspaceFiles.end(); ++it)
|
||||
@ -246,7 +246,7 @@ void MainWindow::setCurrentWorkspace(const QString &workspace)
|
||||
addWorkspace(new_workspace);
|
||||
|
||||
if(!QDir::setCurrent(new_workspace))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not change current diectory to '%0'").arg(new_workspace), QMessageBox::Ok );
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not change current directory to '%0'").arg(new_workspace), QMessageBox::Ok );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -288,7 +288,7 @@ bool MainWindow::openWorkspace(const QString &path)
|
||||
|
||||
if(!(QFileInfo(checkout_file1).exists() || QFileInfo(checkout_file2).exists()) )
|
||||
{
|
||||
if(QMessageBox::Yes !=DialogQuery(this, tr("Open Fossil"), tr("A workspace does not exist in this folder.\nWould you like to create one here?")))
|
||||
if(QMessageBox::Yes !=DialogQuery(this, tr("Open Workspace"), tr("A workspace does not exist in this folder.\nWould you like to create one here?")))
|
||||
{
|
||||
wkspace = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
@ -366,7 +366,7 @@ void MainWindow::on_actionOpenRepository_triggered()
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionNewRepository_triggered()
|
||||
{
|
||||
QString filter(tr("Repositories (*.fossil)"));
|
||||
QString filter(tr("Fossil Repositories (*.fossil)"));
|
||||
|
||||
// Get Repository file
|
||||
QString repo_path = QFileDialog::getSaveFileName(
|
||||
@ -591,7 +591,7 @@ bool MainWindow::refresh()
|
||||
}
|
||||
else if(st==REPO_OLD_SCHEMA)
|
||||
{
|
||||
setStatus(tr("Old fossil schema detected. Consider running 'fossil rebuild'"));
|
||||
setStatus(tr("Old repository schema detected. Consider running 'fossil rebuild'"));
|
||||
enableActions(false);
|
||||
repoFileModel.removeRows(0, repoFileModel.rowCount());
|
||||
repoDirModel.clear();
|
||||
@ -648,7 +648,7 @@ void MainWindow::scanWorkspace()
|
||||
if(!ui->actionViewIgnored->isChecked())
|
||||
{
|
||||
// QDir expects multiple specs being separated by a semicolon
|
||||
ignore = settings.Mappings[FUEL_SETTING_IGNORE_GLOB].Value.toString().replace(',',';');
|
||||
ignore = settings.GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString().replace(',',';');
|
||||
}
|
||||
|
||||
scanDirectory(all_files, wkdir, wkdir, ignore);
|
||||
@ -1093,7 +1093,7 @@ bool MainWindow::runFossilRaw(const QStringList &args, QStringList *output, int
|
||||
process.start(fossil, args);
|
||||
if(!process.waitForStarted())
|
||||
{
|
||||
log(tr("Could not start Fossil executable '%s'\n").arg(fossil));
|
||||
log(tr("Could not start Fossil executable '%s'").arg(fossil)+"\n");
|
||||
return false;
|
||||
}
|
||||
const QChar EOL_MARK('\n');
|
||||
@ -1264,7 +1264,7 @@ bool MainWindow::runFossilRaw(const QStringList &args, QStringList *output, int
|
||||
QString MainWindow::getFossilPath()
|
||||
{
|
||||
// Use the user-specified fossil if available
|
||||
QString fossil_path = settings.Mappings[FUEL_SETTING_FOSSIL_PATH].Value.toString();
|
||||
QString fossil_path = settings.GetValue(FUEL_SETTING_FOSSIL_PATH).toString();
|
||||
if(!fossil_path.isEmpty())
|
||||
return QDir::toNativeSeparators(fossil_path);
|
||||
|
||||
@ -1282,22 +1282,15 @@ QString MainWindow::getFossilPath()
|
||||
return fossil_exe;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::loadSettings()
|
||||
void MainWindow::applySettings()
|
||||
{
|
||||
if(settings.store->contains(FUEL_SETTING_FOSSIL_PATH))
|
||||
settings.Mappings[FUEL_SETTING_FOSSIL_PATH].Value = settings.store->value(FUEL_SETTING_FOSSIL_PATH);
|
||||
QSettings *store = settings.GetStore();
|
||||
|
||||
if(settings.store->contains(FUEL_SETTING_COMMIT_MSG))
|
||||
settings.Mappings[FUEL_SETTING_COMMIT_MSG].Value = settings.store->value(FUEL_SETTING_COMMIT_MSG);
|
||||
|
||||
if(settings.store->contains(FUEL_SETTING_FILE_DBLCLICK))
|
||||
settings.Mappings[FUEL_SETTING_FILE_DBLCLICK].Value = settings.store->value(FUEL_SETTING_FILE_DBLCLICK);
|
||||
|
||||
int num_wks = settings.store->beginReadArray("Workspaces");
|
||||
int num_wks = store->beginReadArray("Workspaces");
|
||||
for(int i=0; i<num_wks; ++i)
|
||||
{
|
||||
settings.store->setArrayIndex(i);
|
||||
QString wk = settings.store->value("Path").toString();
|
||||
store->setArrayIndex(i);
|
||||
QString wk = store->value("Path").toString();
|
||||
|
||||
// Skip invalid workspaces
|
||||
if(wk.isEmpty() || !QDir(wk).exists())
|
||||
@ -1305,80 +1298,75 @@ void MainWindow::loadSettings()
|
||||
|
||||
addWorkspace(wk);
|
||||
|
||||
if(settings.store->contains("Active") && settings.store->value("Active").toBool())
|
||||
if(store->contains("Active") && store->value("Active").toBool())
|
||||
setCurrentWorkspace(wk);
|
||||
}
|
||||
settings.store->endArray();
|
||||
store->endArray();
|
||||
|
||||
|
||||
if(settings.store->contains("WindowX") && settings.store->contains("WindowY"))
|
||||
if(store->contains("WindowX") && store->contains("WindowY"))
|
||||
{
|
||||
QPoint _pos;
|
||||
_pos.setX(settings.store->value("WindowX").toInt());
|
||||
_pos.setY(settings.store->value("WindowY").toInt());
|
||||
_pos.setX(store->value("WindowX").toInt());
|
||||
_pos.setY(store->value("WindowY").toInt());
|
||||
move(_pos);
|
||||
}
|
||||
|
||||
if(settings.store->contains("WindowWidth") && settings.store->contains("WindowHeight"))
|
||||
if(store->contains("WindowWidth") && store->contains("WindowHeight"))
|
||||
{
|
||||
QSize _size;
|
||||
_size.setWidth(settings.store->value("WindowWidth").toInt());
|
||||
_size.setHeight(settings.store->value("WindowHeight").toInt());
|
||||
_size.setWidth(store->value("WindowWidth").toInt());
|
||||
_size.setHeight(store->value("WindowHeight").toInt());
|
||||
resize(_size);
|
||||
}
|
||||
|
||||
if(settings.store->contains("ViewUnknown"))
|
||||
ui->actionViewUnknown->setChecked(settings.store->value("ViewUnknown").toBool());
|
||||
if(settings.store->contains("ViewModified"))
|
||||
ui->actionViewModified->setChecked(settings.store->value("ViewModified").toBool());
|
||||
if(settings.store->contains("ViewUnchanged"))
|
||||
ui->actionViewUnchanged->setChecked(settings.store->value("ViewUnchanged").toBool());
|
||||
if(settings.store->contains("ViewIgnored"))
|
||||
ui->actionViewIgnored->setChecked(settings.store->value("ViewIgnored").toBool());
|
||||
if(settings.store->contains("ViewAsList"))
|
||||
if(store->contains("ViewUnknown"))
|
||||
ui->actionViewUnknown->setChecked(store->value("ViewUnknown").toBool());
|
||||
if(store->contains("ViewModified"))
|
||||
ui->actionViewModified->setChecked(store->value("ViewModified").toBool());
|
||||
if(store->contains("ViewUnchanged"))
|
||||
ui->actionViewUnchanged->setChecked(store->value("ViewUnchanged").toBool());
|
||||
if(store->contains("ViewIgnored"))
|
||||
ui->actionViewIgnored->setChecked(store->value("ViewIgnored").toBool());
|
||||
if(store->contains("ViewAsList"))
|
||||
{
|
||||
ui->actionViewAsList->setChecked(settings.store->value("ViewAsList").toBool());
|
||||
viewMode = settings.store->value("ViewAsList").toBool()? VIEWMODE_LIST : VIEWMODE_TREE;
|
||||
ui->actionViewAsList->setChecked(store->value("ViewAsList").toBool());
|
||||
viewMode = store->value("ViewAsList").toBool()? VIEWMODE_LIST : VIEWMODE_TREE;
|
||||
}
|
||||
ui->treeView->setVisible(viewMode == VIEWMODE_TREE);
|
||||
|
||||
if(settings.store->contains("ViewStash"))
|
||||
ui->actionViewStash->setChecked(settings.store->value("ViewStash").toBool());
|
||||
if(store->contains("ViewStash"))
|
||||
ui->actionViewStash->setChecked(store->value("ViewStash").toBool());
|
||||
ui->tableViewStash->setVisible(ui->actionViewStash->isChecked());
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::saveSettings()
|
||||
void MainWindow::updateSettings()
|
||||
{
|
||||
// If we have a customize fossil path, save it
|
||||
QString fossil_path = settings.Mappings[FUEL_SETTING_FOSSIL_PATH].Value.toString();
|
||||
settings.store->setValue(FUEL_SETTING_FOSSIL_PATH, fossil_path);
|
||||
settings.store->setValue(FUEL_SETTING_COMMIT_MSG, settings.Mappings[FUEL_SETTING_COMMIT_MSG].Value);
|
||||
settings.store->setValue(FUEL_SETTING_FILE_DBLCLICK, settings.Mappings[FUEL_SETTING_FILE_DBLCLICK].Value);
|
||||
QSettings *store = settings.GetStore();
|
||||
|
||||
settings.store->beginWriteArray("Workspaces", workspaceHistory.size());
|
||||
store->beginWriteArray("Workspaces", workspaceHistory.size());
|
||||
for(int i=0; i<workspaceHistory.size(); ++i)
|
||||
{
|
||||
settings.store->setArrayIndex(i);
|
||||
settings.store->setValue("Path", workspaceHistory[i]);
|
||||
store->setArrayIndex(i);
|
||||
store->setValue("Path", workspaceHistory[i]);
|
||||
if(getCurrentWorkspace() == workspaceHistory[i])
|
||||
settings.store->setValue("Active", true);
|
||||
store->setValue("Active", true);
|
||||
else
|
||||
settings.store->remove("Active");
|
||||
store->remove("Active");
|
||||
}
|
||||
settings.store->endArray();
|
||||
store->endArray();
|
||||
|
||||
settings.store->setValue("WindowX", x());
|
||||
settings.store->setValue("WindowY", y());
|
||||
settings.store->setValue("WindowWidth", width());
|
||||
settings.store->setValue("WindowHeight", height());
|
||||
settings.store->setValue("ViewUnknown", ui->actionViewUnknown->isChecked());
|
||||
settings.store->setValue("ViewModified", ui->actionViewModified->isChecked());
|
||||
settings.store->setValue("ViewUnchanged", ui->actionViewUnchanged->isChecked());
|
||||
settings.store->setValue("ViewIgnored", ui->actionViewIgnored->isChecked());
|
||||
settings.store->setValue("ViewAsList", ui->actionViewAsList->isChecked());
|
||||
settings.store->setValue("ViewStash", ui->actionViewStash->isChecked());
|
||||
store->setValue("WindowX", x());
|
||||
store->setValue("WindowY", y());
|
||||
store->setValue("WindowWidth", width());
|
||||
store->setValue("WindowHeight", height());
|
||||
store->setValue("ViewUnknown", ui->actionViewUnknown->isChecked());
|
||||
store->setValue("ViewModified", ui->actionViewModified->isChecked());
|
||||
store->setValue("ViewUnchanged", ui->actionViewUnchanged->isChecked());
|
||||
store->setValue("ViewIgnored", ui->actionViewIgnored->isChecked());
|
||||
store->setValue("ViewAsList", ui->actionViewAsList->isChecked());
|
||||
store->setValue("ViewStash", ui->actionViewStash->isChecked());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -1551,7 +1539,7 @@ bool MainWindow::startUI()
|
||||
{
|
||||
if(uiRunning())
|
||||
{
|
||||
log(tr("Fossil UI is already running\n"));
|
||||
log(tr("Fossil UI is already running")+"\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1560,13 +1548,13 @@ bool MainWindow::startUI()
|
||||
fossilUI.setWorkingDirectory(getCurrentWorkspace());
|
||||
|
||||
log("<b>> fossil ui</b><br>", true);
|
||||
log(tr("Starting Fossil browser UI. Please wait.\n"));
|
||||
log(tr("Starting Fossil browser UI. Please wait.")+"\n");
|
||||
QString fossil = getFossilPath();
|
||||
|
||||
fossilUI.start(fossil, QStringList() << "ui");
|
||||
if(!fossilUI.waitForStarted() || fossilUI.state()!=QProcess::Running)
|
||||
{
|
||||
log(tr("Could not start Fossil executable '%s'\n").arg(fossil));
|
||||
log(tr("Could not start Fossil executable '%s'").arg(fossil)+"\n");
|
||||
ui->actionFossilUI->setChecked(false);
|
||||
return false;
|
||||
}
|
||||
@ -1659,7 +1647,7 @@ void MainWindow::on_actionHistory_triggered()
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_tableView_doubleClicked(const QModelIndex &/*index*/)
|
||||
{
|
||||
int action = settings.Mappings[FUEL_SETTING_FILE_DBLCLICK].Value.toInt();
|
||||
int action = settings.GetValue(FUEL_SETTING_FILE_DBLCLICK).toInt();
|
||||
if(action==FILE_DLBCLICK_ACTION_DIFF)
|
||||
on_actionDiff_triggered();
|
||||
else if(action==FILE_DLBCLICK_ACTION_OPEN)
|
||||
@ -1683,7 +1671,7 @@ void MainWindow::on_actionOpenFile_triggered()
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPush_triggered()
|
||||
{
|
||||
QString remote_url = settings.Mappings[FUEL_SETTING_REMOTE_URL].Value.toString();
|
||||
QString remote_url = settings.GetFossilValue(FOSSIL_SETTING_REMOTE_URL).toString();
|
||||
|
||||
if(remote_url.isEmpty() || remote_url == "off")
|
||||
{
|
||||
@ -1697,7 +1685,7 @@ void MainWindow::on_actionPush_triggered()
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPull_triggered()
|
||||
{
|
||||
QString remote_url = settings.Mappings[FUEL_SETTING_REMOTE_URL].Value.toString();
|
||||
QString remote_url = settings.GetFossilValue(FOSSIL_SETTING_REMOTE_URL).toString();
|
||||
|
||||
if(remote_url.isEmpty() || remote_url == "off")
|
||||
{
|
||||
@ -1717,7 +1705,7 @@ void MainWindow::on_actionCommit_triggered()
|
||||
if(commit_files.empty())
|
||||
return;
|
||||
|
||||
QStringList commit_msgs = settings.Mappings[FUEL_SETTING_COMMIT_MSG].Value.toStringList();
|
||||
QStringList commit_msgs = settings.GetValue(FUEL_SETTING_COMMIT_MSG).toStringList();
|
||||
|
||||
QString msg;
|
||||
bool aborted = !CommitDialog::run(this, tr("Commit Changes"), commit_files, msg, &commit_msgs);
|
||||
@ -1727,7 +1715,7 @@ void MainWindow::on_actionCommit_triggered()
|
||||
if(commit_msgs.indexOf(msg)==-1)
|
||||
{
|
||||
commit_msgs.push_front(msg);
|
||||
settings.Mappings[FUEL_SETTING_COMMIT_MSG].Value = commit_msgs;
|
||||
settings.SetValue(FUEL_SETTING_COMMIT_MSG, commit_msgs);
|
||||
}
|
||||
|
||||
if(aborted)
|
||||
@ -1867,7 +1855,7 @@ void MainWindow::on_actionRename_triggered()
|
||||
QFileInfo fi_before(repo_files[0]);
|
||||
|
||||
bool ok = false;
|
||||
QString new_name = QInputDialog::getText(this, tr("Rename"), tr("Enter new name"), QLineEdit::Normal, fi_before.filePath(), &ok, Qt::Sheet );
|
||||
QString new_name = QInputDialog::getText(this, tr("Rename"), tr("New name"), QLineEdit::Normal, fi_before.filePath(), &ok, Qt::Sheet );
|
||||
if(!ok)
|
||||
return;
|
||||
|
||||
@ -1948,7 +1936,7 @@ void MainWindow::on_actionAbout_triggered()
|
||||
QCoreApplication::applicationName() + " "+ QCoreApplication::applicationVersion() + " " +
|
||||
tr("a GUI frontend to the Fossil SCM\n"
|
||||
"by Kostas Karanikolas\n"
|
||||
"Released under the GNU GPL\n\n")
|
||||
"Released under the GNU GPL")+"\n\n"
|
||||
+ fossil_ver +
|
||||
tr("Icon-set by Deleket - Jojo Mendoza\n"
|
||||
"Available under the CC Attribution Noncommercial No Derivate 3.0 License"));
|
||||
@ -1984,15 +1972,11 @@ void MainWindow::loadFossilSettings()
|
||||
|
||||
QStringMap kv = MakeKeyValues(out);
|
||||
|
||||
for(Settings::mappings_t::iterator it=settings.Mappings.begin(); it!=settings.Mappings.end(); ++it)
|
||||
for(Settings::mappings_t::iterator it=settings.GetMappings().begin(); it!=settings.GetMappings().end(); ++it)
|
||||
{
|
||||
const QString &name = it.key();
|
||||
Settings::Setting::SettingType type = it->Type;
|
||||
|
||||
// Internal types are handled explicitly
|
||||
if(type == Settings::Setting::TYPE_INTERNAL)
|
||||
continue;
|
||||
|
||||
// Command types we issue directly on fossil
|
||||
if(type == Settings::Setting::TYPE_FOSSIL_COMMAND)
|
||||
{
|
||||
@ -2034,15 +2018,11 @@ void MainWindow::on_actionSettings_triggered()
|
||||
return;
|
||||
|
||||
// Apply settings
|
||||
for(Settings::mappings_t::iterator it=settings.Mappings.begin(); it!=settings.Mappings.end(); ++it)
|
||||
for(Settings::mappings_t::iterator it=settings.GetMappings().begin(); it!=settings.GetMappings().end(); ++it)
|
||||
{
|
||||
const QString &name = it.key();
|
||||
Settings::Setting::SettingType type = it.value().Type;
|
||||
|
||||
// Internal types are handled explicitly
|
||||
if(type == Settings::Setting::TYPE_INTERNAL)
|
||||
continue;
|
||||
|
||||
// Command types we issue directly on fossil
|
||||
if(type == Settings::Setting::TYPE_FOSSIL_COMMAND)
|
||||
{
|
||||
@ -2178,7 +2158,7 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
QString old_name = old_path.mid(dir_start);
|
||||
|
||||
bool ok = false;
|
||||
QString new_name = QInputDialog::getText(this, tr("Rename Folder"), tr("Enter new name"), QLineEdit::Normal, old_name, &ok, Qt::Sheet);
|
||||
QString new_name = QInputDialog::getText(this, tr("Rename Folder"), tr("New name"), QLineEdit::Normal, old_name, &ok, Qt::Sheet);
|
||||
if(!ok || old_name==new_name)
|
||||
return;
|
||||
|
||||
@ -2190,7 +2170,7 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
{
|
||||
if(new_name.indexOf(invalid_tokens[i])!=-1)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot rename folder.\nFolder name contains invalid characters."));
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot rename folder.")+"\n" +tr("Folder name contains invalid characters."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2199,7 +2179,7 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
|
||||
if(pathSet.contains(new_path))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot rename folder.\nThis folder exists already."));
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot rename folder.")+"\n" +tr("This folder exists already."));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2239,7 +2219,7 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
|
||||
if(!runFossil(QStringList() << "mv" << QuotePath(r->getFilePath()) << QuotePath(new_file_path)))
|
||||
{
|
||||
log(tr("Move aborted due to errors\n"));
|
||||
log(tr("Move aborted due to errors")+"\n");
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
@ -2259,10 +2239,10 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
QDir wkdir(getCurrentWorkspace());
|
||||
Q_ASSERT(wkdir.exists());
|
||||
|
||||
log(tr("Creating folder '%0'\n").arg(target_path));
|
||||
log(tr("Creating folder '%0'").arg(target_path)+"\n");
|
||||
if(!wkdir.mkpath(new_paths[i] + PATH_SEP + "."))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot make target folder '%0'\n").arg(target_path));
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot make target folder '%0'").arg(target_path));
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
@ -2279,7 +2259,7 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
log(tr("Copying file '%0' to '%1'\n").arg(r->getFilePath(), new_file_path));
|
||||
log(tr("Copying file '%0' to '%1'").arg(r->getFilePath(), new_file_path)+"\n");
|
||||
|
||||
if(!QFile::copy(r->getFilePath(), new_file_path))
|
||||
{
|
||||
@ -2293,7 +2273,7 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
{
|
||||
RepoFile *r = files_to_move[i];
|
||||
|
||||
log(tr("Removing old file '%0'\n").arg(r->getFilePath()));
|
||||
log(tr("Removing old file '%0'").arg(r->getFilePath())+"\n");
|
||||
|
||||
if(!QFile::exists(r->getFilePath()))
|
||||
{
|
||||
@ -2308,7 +2288,7 @@ void MainWindow::on_actionRenameFolder_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
log(tr("Folder renamed completed. Don't forget to commit!\n"));
|
||||
log(tr("Folder renamed completed. Don't forget to commit!")+"\n");
|
||||
|
||||
_exit:
|
||||
refresh();
|
||||
@ -2386,7 +2366,7 @@ void MainWindow::on_actionApplyStash_triggered()
|
||||
|
||||
if(!runFossil(QStringList() << "stash" << "apply" << *id_it))
|
||||
{
|
||||
log(tr("Stash application aborted due to errors\n"));
|
||||
log(tr("Stash application aborted due to errors")+"\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2399,7 +2379,7 @@ void MainWindow::on_actionApplyStash_triggered()
|
||||
|
||||
if(!runFossil(QStringList() << "stash" << "drop" << *id_it))
|
||||
{
|
||||
log(tr("Stash deletion aborted due to errors\n"));
|
||||
log(tr("Stash deletion aborted due to errors")+"\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2427,7 +2407,7 @@ void MainWindow::on_actionDeleteStash_triggered()
|
||||
|
||||
if(!runFossil(QStringList() << "stash" << "drop" << *id_it))
|
||||
{
|
||||
log(tr("Stash deletion aborted due to errors\n"));
|
||||
log(tr("Stash deletion aborted due to errors")+"\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -136,8 +136,8 @@ private:
|
||||
void scanWorkspace();
|
||||
bool runFossil(const QStringList &args, QStringList *output=0, int runFlags=RUNFLAGS_NONE);
|
||||
bool runFossilRaw(const QStringList &args, QStringList *output=0, int *exitCode=0, int runFlags=RUNFLAGS_NONE);
|
||||
void loadSettings();
|
||||
void saveSettings();
|
||||
void applySettings();
|
||||
void updateSettings();
|
||||
const QString &getCurrentWorkspace();
|
||||
void setCurrentWorkspace(const QString &workspace);
|
||||
void log(const QString &text, bool isHTML=false);
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <QResource>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
QString SettingsDialog::SelectExe(QWidget *parent, const QString &description)
|
||||
{
|
||||
QString filter(tr("Applications"));
|
||||
@ -39,20 +40,31 @@ SettingsDialog::SettingsDialog(QWidget *parent, Settings &_settings) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
CreateLangMap();
|
||||
|
||||
ui->cmbDoubleClickAction->addItem(tr("Diff File"));
|
||||
ui->cmbDoubleClickAction->addItem(tr("Open File"));
|
||||
ui->cmbDoubleClickAction->addItem(tr("Open Containing Folder"));
|
||||
|
||||
// App Settings
|
||||
ui->lineFossilPath->setText(QDir::toNativeSeparators(settings->Mappings[FUEL_SETTING_FOSSIL_PATH].Value.toString()));
|
||||
ui->lineGDiffCommand->setText(QDir::toNativeSeparators(settings->Mappings[FUEL_SETTING_GDIFF_CMD].Value.toString()));
|
||||
ui->lineGMergeCommand->setText(QDir::toNativeSeparators(settings->Mappings[FUEL_SETTING_GMERGE_CMD].Value.toString()));
|
||||
ui->cmbDoubleClickAction->setCurrentIndex(settings->Mappings[FUEL_SETTING_FILE_DBLCLICK].Value.toInt());
|
||||
ui->lineFossilPath->setText(QDir::toNativeSeparators(settings->GetValue(FUEL_SETTING_FOSSIL_PATH).toString()));
|
||||
ui->cmbDoubleClickAction->setCurrentIndex(settings->GetValue(FUEL_SETTING_FILE_DBLCLICK).toInt());
|
||||
|
||||
// Initialize language combo
|
||||
foreach(const LangMap &m, langMap)
|
||||
ui->cmbActiveLanguage->addItem(m.name);
|
||||
|
||||
// Select current language
|
||||
ui->cmbActiveLanguage->setCurrentIndex(
|
||||
ui->cmbActiveLanguage->findText(
|
||||
LangIdToName(settings->GetValue(FUEL_SETTING_LANGUAGE).toString())));
|
||||
|
||||
// Repo Settings
|
||||
ui->lineRemoteURL->setText(settings->Mappings[FUEL_SETTING_REMOTE_URL].Value.toString());
|
||||
ui->lineIgnore->setText(settings->Mappings[FUEL_SETTING_IGNORE_GLOB].Value.toString());
|
||||
ui->lineIgnoreCRNL->setText(settings->Mappings[FUEL_SETTING_CRNL_GLOB].Value.toString());
|
||||
ui->lineGDiffCommand->setText(QDir::toNativeSeparators(settings->GetFossilValue(FOSSIL_SETTING_GDIFF_CMD).toString()));
|
||||
ui->lineGMergeCommand->setText(QDir::toNativeSeparators(settings->GetFossilValue(FOSSIL_SETTING_GMERGE_CMD).toString()));
|
||||
ui->lineRemoteURL->setText(settings->GetFossilValue(FOSSIL_SETTING_REMOTE_URL).toString());
|
||||
ui->lineIgnore->setText(settings->GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString());
|
||||
ui->lineIgnoreCRNL->setText(settings->GetFossilValue(FOSSIL_SETTING_CRNL_GLOB).toString());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -71,16 +83,28 @@ bool SettingsDialog::run(QWidget *parent, Settings &settings)
|
||||
//-----------------------------------------------------------------------------
|
||||
void SettingsDialog::on_buttonBox_accepted()
|
||||
{
|
||||
settings->Mappings[FUEL_SETTING_FOSSIL_PATH].Value = QDir::fromNativeSeparators(ui->lineFossilPath->text());
|
||||
settings->Mappings[FUEL_SETTING_GDIFF_CMD].Value = QDir::fromNativeSeparators(ui->lineGDiffCommand->text());
|
||||
settings->Mappings[FUEL_SETTING_GMERGE_CMD].Value = QDir::fromNativeSeparators(ui->lineGMergeCommand->text());
|
||||
settings->SetValue(FUEL_SETTING_FOSSIL_PATH, QDir::fromNativeSeparators(ui->lineFossilPath->text()));
|
||||
Q_ASSERT(ui->cmbDoubleClickAction->currentIndex()>=FILE_DLBCLICK_ACTION_DIFF && ui->cmbDoubleClickAction->currentIndex()<FILE_DLBCLICK_ACTION_MAX);
|
||||
settings->Mappings[FUEL_SETTING_FILE_DBLCLICK].Value = ui->cmbDoubleClickAction->currentIndex();
|
||||
settings->SetValue(FUEL_SETTING_FILE_DBLCLICK, ui->cmbDoubleClickAction->currentIndex());
|
||||
|
||||
settings->Mappings[FUEL_SETTING_REMOTE_URL].Value = ui->lineRemoteURL->text();
|
||||
settings->Mappings[FUEL_SETTING_IGNORE_GLOB].Value = ui->lineIgnore->text();
|
||||
settings->Mappings[FUEL_SETTING_CRNL_GLOB].Value = ui->lineIgnoreCRNL->text();
|
||||
Q_ASSERT(settings->HasValue(FUEL_SETTING_LANGUAGE));
|
||||
QString curr_langid = settings->GetValue(FUEL_SETTING_LANGUAGE).toString();
|
||||
QString new_langid = LangNameToId(ui->cmbActiveLanguage->currentText());
|
||||
Q_ASSERT(!new_langid.isEmpty());
|
||||
settings->SetValue(FUEL_SETTING_LANGUAGE, new_langid);
|
||||
|
||||
if(curr_langid != new_langid)
|
||||
QMessageBox::information(this, tr("Restart required"), tr("The language change will take effect after restarting the application"), QMessageBox::Ok);
|
||||
|
||||
settings->SetFossilValue(FOSSIL_SETTING_GDIFF_CMD, QDir::fromNativeSeparators(ui->lineGDiffCommand->text()));
|
||||
settings->SetFossilValue(FOSSIL_SETTING_GMERGE_CMD, QDir::fromNativeSeparators(ui->lineGMergeCommand->text()));
|
||||
settings->SetFossilValue(FOSSIL_SETTING_REMOTE_URL, ui->lineRemoteURL->text());
|
||||
settings->SetFossilValue(FOSSIL_SETTING_IGNORE_GLOB, ui->lineIgnore->text());
|
||||
settings->SetFossilValue(FOSSIL_SETTING_CRNL_GLOB, ui->lineIgnoreCRNL->text());
|
||||
|
||||
settings->ApplyEnvironment();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void SettingsDialog::on_btnSelectFossil_clicked()
|
||||
{
|
||||
@ -109,21 +133,49 @@ void SettingsDialog::on_btnSelectGMerge_clicked()
|
||||
void SettingsDialog::on_btnClearMessageHistory_clicked()
|
||||
{
|
||||
if(DialogQuery(this, tr("Clear Commit Message History"), tr("Are you sure want to clear the commit message history?"))==QMessageBox::Yes)
|
||||
settings->Mappings[FUEL_SETTING_COMMIT_MSG].Value = QStringList();
|
||||
settings->SetValue(FUEL_SETTING_COMMIT_MSG, QStringList());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void SettingsDialog::CreateLangMap()
|
||||
{
|
||||
langMap.append(LangMap("en_US", tr("English (US)")));
|
||||
langMap.append(LangMap("ja_JP", tr("Japanese")));
|
||||
langMap.append(LangMap("el_GR", tr("Greek")));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QString SettingsDialog::LangIdToName(const QString &id)
|
||||
{
|
||||
foreach(const LangMap &m, langMap)
|
||||
{
|
||||
if(m.id == id)
|
||||
return m.name;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QString SettingsDialog::LangNameToId(const QString &name)
|
||||
{
|
||||
foreach(const LangMap &m, langMap)
|
||||
{
|
||||
if(m.name == name)
|
||||
return m.id;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
Settings::Settings(bool portableMode) : store(0)
|
||||
{
|
||||
Mappings[FUEL_SETTING_FOSSIL_PATH] = Setting();
|
||||
Mappings[FUEL_SETTING_COMMIT_MSG] = Setting();
|
||||
Mappings[FUEL_SETTING_FILE_DBLCLICK] = Setting(0); // Maps to FileDblClickAction
|
||||
Mappings[FUEL_SETTING_GDIFF_CMD] = Setting("", Setting::TYPE_FOSSIL_GLOBAL);
|
||||
Mappings[FUEL_SETTING_GMERGE_CMD] = Setting("", Setting::TYPE_FOSSIL_GLOBAL);
|
||||
Mappings[FUEL_SETTING_IGNORE_GLOB] = Setting("", Setting::TYPE_FOSSIL_LOCAL);
|
||||
Mappings[FUEL_SETTING_CRNL_GLOB] = Setting("", Setting::TYPE_FOSSIL_LOCAL);
|
||||
Mappings[FUEL_SETTING_REMOTE_URL] = Setting("off", Setting::TYPE_FOSSIL_COMMAND);
|
||||
|
||||
Mappings.insert(FOSSIL_SETTING_GDIFF_CMD, Setting("", Setting::TYPE_FOSSIL_GLOBAL));
|
||||
Mappings.insert(FOSSIL_SETTING_GMERGE_CMD, Setting("", Setting::TYPE_FOSSIL_GLOBAL));
|
||||
Mappings.insert(FOSSIL_SETTING_IGNORE_GLOB, Setting("", Setting::TYPE_FOSSIL_LOCAL));
|
||||
Mappings.insert(FOSSIL_SETTING_CRNL_GLOB, Setting("", Setting::TYPE_FOSSIL_LOCAL));
|
||||
Mappings.insert(FOSSIL_SETTING_REMOTE_URL, Setting("off", Setting::TYPE_FOSSIL_COMMAND));
|
||||
|
||||
// Go into portable mode when explicitly requested or if a config file exists next to the executable
|
||||
QString ini_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + QDir::separator() + QCoreApplication::applicationName() + ".ini");
|
||||
@ -135,6 +187,12 @@ Settings::Settings(bool portableMode) : store(0)
|
||||
// Windows: HKEY_CURRENT_USER\Software\organizationName\Fuel
|
||||
store = new QSettings(QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName());
|
||||
}
|
||||
Q_ASSERT(store);
|
||||
|
||||
if(!HasValue(FUEL_SETTING_FILE_DBLCLICK))
|
||||
SetValue(FUEL_SETTING_FILE_DBLCLICK, 0);
|
||||
if(!HasValue(FUEL_SETTING_LANGUAGE))
|
||||
SetValue(FUEL_SETTING_LANGUAGE, QLocale::system().name());
|
||||
|
||||
ApplyEnvironment();
|
||||
}
|
||||
@ -142,17 +200,54 @@ Settings::Settings(bool portableMode) : store(0)
|
||||
//-----------------------------------------------------------------------------
|
||||
Settings::~Settings()
|
||||
{
|
||||
Q_ASSERT(store);
|
||||
delete store;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void Settings::ApplyEnvironment()
|
||||
{
|
||||
QString locale_name = QLocale::system().name();
|
||||
//locale_name = "el_GR";
|
||||
QString lang_id = GetValue(FUEL_SETTING_LANGUAGE).toString();
|
||||
|
||||
QString locale_path = QString(":intl/intl/%0.qm").arg(locale_name);
|
||||
QString locale_path = QString(":intl/intl/%0.qm").arg(lang_id);
|
||||
QResource res(locale_path);
|
||||
if(res.isValid() && translator.load(res.data(), res.size()))
|
||||
QCoreApplication::instance()->installTranslator(&translator);
|
||||
else
|
||||
SetValue(FUEL_SETTING_LANGUAGE, "en_US");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Settings::HasValue(const QString &name) const
|
||||
{
|
||||
return store->contains(name);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
const QVariant Settings::GetValue(const QString &name)
|
||||
{
|
||||
Q_ASSERT(HasValue(name));
|
||||
return store->value(name);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void Settings::SetValue(const QString &name, const QVariant &value)
|
||||
{
|
||||
store->setValue(name, value);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QVariant &Settings::GetFossilValue(const QString &name)
|
||||
{
|
||||
mappings_t::iterator it=Mappings.find(name);
|
||||
Q_ASSERT(it!=Mappings.end());
|
||||
return it.value().Value;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void Settings::SetFossilValue(const QString &name, const QVariant &value)
|
||||
{
|
||||
mappings_t::iterator it=Mappings.find(name);
|
||||
Q_ASSERT(it!=Mappings.end());
|
||||
it->Value = value;
|
||||
}
|
||||
|
@ -14,11 +14,14 @@ namespace Ui {
|
||||
#define FUEL_SETTING_FOSSIL_PATH "FossilPath"
|
||||
#define FUEL_SETTING_COMMIT_MSG "CommitMsgHistory"
|
||||
#define FUEL_SETTING_FILE_DBLCLICK "FileDblClickAction"
|
||||
#define FUEL_SETTING_GDIFF_CMD "gdiff-command"
|
||||
#define FUEL_SETTING_GMERGE_CMD "gmerge-command"
|
||||
#define FUEL_SETTING_IGNORE_GLOB "ignore-glob"
|
||||
#define FUEL_SETTING_CRNL_GLOB "crnl-glob"
|
||||
#define FUEL_SETTING_REMOTE_URL "remote-url"
|
||||
#define FUEL_SETTING_LANGUAGE "Language"
|
||||
|
||||
#define FOSSIL_SETTING_GDIFF_CMD "gdiff-command"
|
||||
#define FOSSIL_SETTING_GMERGE_CMD "gmerge-command"
|
||||
#define FOSSIL_SETTING_IGNORE_GLOB "ignore-glob"
|
||||
#define FOSSIL_SETTING_CRNL_GLOB "crnl-glob"
|
||||
#define FOSSIL_SETTING_REMOTE_URL "remote-url"
|
||||
|
||||
|
||||
enum FileDblClickAction
|
||||
{
|
||||
@ -34,27 +37,38 @@ struct Settings
|
||||
{
|
||||
enum SettingType
|
||||
{
|
||||
TYPE_INTERNAL,
|
||||
TYPE_FOSSIL_GLOBAL,
|
||||
TYPE_FOSSIL_LOCAL,
|
||||
TYPE_FOSSIL_COMMAND
|
||||
};
|
||||
|
||||
Setting(QVariant value=QVariant(), SettingType type=TYPE_INTERNAL) : Value(value), Type(type)
|
||||
Setting(QVariant value, SettingType type) : Value(value), Type(type)
|
||||
{}
|
||||
QVariant Value;
|
||||
SettingType Type;
|
||||
};
|
||||
typedef QMap<QString, Setting> mappings_t;
|
||||
|
||||
|
||||
Settings(bool portableMode = false);
|
||||
~Settings();
|
||||
void ApplyEnvironment();
|
||||
|
||||
typedef QMap<QString, Setting> mappings_t;
|
||||
// App configuration access
|
||||
class QSettings * GetStore() { return store; }
|
||||
bool HasValue(const QString &name) const; // store->contains(FUEL_SETTING_FOSSIL_PATH)
|
||||
const QVariant GetValue(const QString &name); // settings.store->value
|
||||
void SetValue(const QString &name, const QVariant &value); // settings.store->value
|
||||
|
||||
// Fossil configuration access
|
||||
QVariant & GetFossilValue(const QString &name);
|
||||
void SetFossilValue(const QString &name, const QVariant &value);
|
||||
mappings_t & GetMappings() { return Mappings; }
|
||||
|
||||
private:
|
||||
mappings_t Mappings;
|
||||
class QSettings *store;
|
||||
QTranslator translator;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -78,7 +92,22 @@ private slots:
|
||||
|
||||
private:
|
||||
static QString SelectExe(QWidget *parent, const QString &description);
|
||||
QString LangIdToName(const QString &id);
|
||||
QString LangNameToId(const QString &name);
|
||||
void CreateLangMap();
|
||||
|
||||
struct LangMap
|
||||
{
|
||||
LangMap(const QString &_id, const QString &_name)
|
||||
: id(_id), name(_name)
|
||||
{
|
||||
}
|
||||
|
||||
QString id;
|
||||
QString name;
|
||||
};
|
||||
|
||||
QList<LangMap> langMap;
|
||||
Ui::SettingsDialog *ui;
|
||||
Settings *settings;
|
||||
};
|
||||
|
@ -227,6 +227,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="uILanguageLabel">
|
||||
<property name="text">
|
||||
<string>Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="cmbActiveLanguage">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Language to use for the user interface</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabRepo">
|
||||
|
Reference in New Issue
Block a user