Working Fuel-managed remote-url
No more FOSSIL_SETTING_REMOTE_URL uglyness FossilOrigin-Name: 54518e5519ad4d5d478c815cc78859c9120997fe
This commit is contained in:
parent
e6fa4062d0
commit
b1276a7cd1
28
manifest
28
manifest
@ -1,5 +1,5 @@
|
||||
C Implemented\sremote\scredential\sstorage\svia\sqtkeychain\nImported\sqtkeychain
|
||||
D 2015-05-25T14:03:38.817
|
||||
C Working\sFuel-managed\sremote-url\nNo\smore\sFOSSIL_SETTING_REMOTE_URL\suglyness\n
|
||||
D 2015-05-25T19:59:37.320
|
||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||
@ -218,22 +218,22 @@ F src/FileActionDialog.cpp fcaebf9986f789b3440d5390b3458ad5f86fe0c8
|
||||
F src/FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce
|
||||
F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
||||
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
||||
F src/Fossil.cpp 0d4c50327a61c48506d2d45e28cd6f71f1697ea2
|
||||
F src/Fossil.h 31765ef57e20a860914372d56c024033b30aa765
|
||||
F src/FslSettingsDialog.cpp f5a34a70ecb0560d2b6eea6bf27e42048548aedd
|
||||
F src/Fossil.cpp 2b03aeec20149a1b89f10118058fac8ca33425fc
|
||||
F src/Fossil.h e706992b331385660d57df6a27e5418342c14e19
|
||||
F src/FslSettingsDialog.cpp 2531d3709f0eab66651671e3edead2ca720d07d5
|
||||
F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7
|
||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||
F src/MainWindow.cpp 2bfafff682c13a9176b4f4200c54c2c5c55b8ae8
|
||||
F src/MainWindow.h 6cb82a4fc337793a339ffef4728e6d30b7b74305
|
||||
F src/MainWindow.cpp 08e207cc8ef8d59ab1ce92157d8a243bd932ae06
|
||||
F src/MainWindow.h f5981b4144debe4b624afd52223f24fb7b7f2324
|
||||
F src/RemoteDialog.cpp 03a6cf213d6dde68ee0ceb8d122e05da2d491724
|
||||
F src/RemoteDialog.h 364e867210ec55d8d6d23d0c8078f2517b2389ec
|
||||
F src/RevisionDialog.cpp 51065c65a07c118dd1a7363da4a55a135d1c6c9c
|
||||
F src/RevisionDialog.h b718c3009342eaabad39c8a11a253a4e4fef7a73
|
||||
F src/SearchBox.cpp d4209c575baa9933e1ce5ed376e785b289a145ba
|
||||
F src/SearchBox.h 0c78d3a68136dab3e0e71b83ae36f22bd2688ab2
|
||||
F src/Settings.cpp 6ab826273b9693bfcd65f0f59b550ae2aa3577f1
|
||||
F src/Settings.h 1ff8bb71e19949150e8caa4f5e5f13f8810e496b
|
||||
F src/Settings.cpp 7a674604caa9d9f5ffb6b73d95745bde09525389
|
||||
F src/Settings.h 376d0a115237edfb91dee774b10996d35ed197ec
|
||||
F src/SettingsDialog.cpp 25be4c351dd21ea9132321944f42dc0bc22fb128
|
||||
F src/SettingsDialog.h b324dfd77ca3ad24fd83588aaf79a7e4c291e716
|
||||
F src/Utils.cpp abfd679b8a4a320207abe385b8f3a4af8f646a55
|
||||
@ -247,12 +247,12 @@ F ui/BrowserWidget.ui 994ad9ea0e9f5815d6b1a27acc2f6f39164c507f
|
||||
F ui/CloneDialog.ui 4886e7d4f258ea8b852b5eefc860396e35145712
|
||||
F ui/CommitDialog.ui aea77347eef82b6b591f31fb058a1bb96193c728
|
||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||
F ui/FslSettingsDialog.ui 042717833d8efea905b4fc380bad580be809717d
|
||||
F ui/MainWindow.ui 72d363caef1a9ce0484509cdf3e5f924af363381
|
||||
F ui/FslSettingsDialog.ui eb3d4cb764cab90b01e82922237d8c42d6ce1749
|
||||
F ui/MainWindow.ui d51fe6d742278eafffedfd13dd543a3daf30c4a8
|
||||
F ui/RemoteDialog.ui aa738503e4f6625ed8d7cc46169a319a39b0e575
|
||||
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
||||
F ui/SettingsDialog.ui 4c480cd595a32664d01c85bf74845c4282fc0068
|
||||
P 13d3a5222dfe24a33a72efffff0ecb0b5bfefe73
|
||||
R 9e773ad6f2945f8bd613b0b9f6e23acf
|
||||
P 7c068aa8acdae1b86dee004d2d4cd7fb42904186
|
||||
R 0b17bbb41582e9b9eaa8683364460607
|
||||
U kostas
|
||||
Z 96c30d4c2ad3ef32f51d03d388cfc133
|
||||
Z 108dbf16cab161c35c5ff6a9ffa4b8af
|
||||
|
@ -1 +1 @@
|
||||
7c068aa8acdae1b86dee004d2d4cd7fb42904186
|
||||
54518e5519ad4d5d478c815cc78859c9120997fe
|
@ -70,6 +70,10 @@ RepoStatus Fossil::getRepoStatus()
|
||||
}
|
||||
}
|
||||
|
||||
defaultRemoteUrl.clear();
|
||||
if(run_ok)
|
||||
getRemoteUrl(defaultRemoteUrl);
|
||||
|
||||
return run_ok ? REPO_OK : REPO_NOT_FOUND;
|
||||
}
|
||||
|
||||
@ -128,15 +132,51 @@ bool Fossil::status(QStringList &result)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::pushRepository()
|
||||
bool Fossil::pushRepository(const QUrl &url)
|
||||
{
|
||||
return runFossil(QStringList() << "push");
|
||||
QStringList params;
|
||||
params << "push";
|
||||
|
||||
int runFlags=RUNFLAGS_NONE;
|
||||
|
||||
if(!url.isEmpty())
|
||||
{
|
||||
params << url.toString();
|
||||
params << "--once";
|
||||
|
||||
QStringList log_params = params;
|
||||
log_params[1] = url.toDisplayString();
|
||||
log_params.push_front("fossil");
|
||||
|
||||
runFlags = RUNFLAGS_SILENT_INPUT;
|
||||
log("<b>>"+log_params.join(" ")+"</b><br>", true);
|
||||
}
|
||||
|
||||
return runFossil(params, 0, runFlags);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::pullRepository()
|
||||
bool Fossil::pullRepository(const QUrl &url)
|
||||
{
|
||||
return runFossil(QStringList() << "pull");
|
||||
QStringList params;
|
||||
params << "pull";
|
||||
|
||||
int runFlags=RUNFLAGS_NONE;
|
||||
|
||||
if(!url.isEmpty())
|
||||
{
|
||||
params << url.toString();
|
||||
params << "--once";
|
||||
|
||||
QStringList log_params = params;
|
||||
log_params[1] = url.toDisplayString();
|
||||
log_params.push_front("fossil");
|
||||
|
||||
runFlags = RUNFLAGS_SILENT_INPUT;
|
||||
log("<b>>"+log_params.join(" ")+"</b><br>", true);
|
||||
}
|
||||
|
||||
return runFossil(params, 0, runFlags);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -361,20 +401,25 @@ bool Fossil::setFossilSetting(const QString& name, const QString& value, bool gl
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::setRemoteUrl(const QString& url)
|
||||
bool Fossil::setRemoteUrl(const QUrl& url)
|
||||
{
|
||||
QString u = url;
|
||||
QString u = url.toString(QUrl::FullyEncoded);
|
||||
|
||||
if(url.isEmpty())
|
||||
u = "off";
|
||||
|
||||
// Run as silent to avoid displaying credentials in the log
|
||||
// FIXME: maybe use a QUrl instead
|
||||
return runFossil(QStringList() << "remote-url" << u, 0, RUNFLAGS_SILENT_INPUT);
|
||||
bool ok = runFossil(QStringList() << "remote-url" << u, 0, RUNFLAGS_SILENT_INPUT);
|
||||
|
||||
// Retrieve default url
|
||||
if(ok)
|
||||
getRemoteUrl(defaultRemoteUrl);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::getRemoteUrl(QString& url)
|
||||
bool Fossil::getRemoteUrl(QUrl& url)
|
||||
{
|
||||
url.clear();
|
||||
|
||||
@ -382,8 +427,15 @@ bool Fossil::getRemoteUrl(QString& url)
|
||||
if(!runFossil(QStringList() << "remote-url", &out, RUNFLAGS_SILENT_ALL))
|
||||
return false;
|
||||
|
||||
QString url_str;
|
||||
if(out.length()>0)
|
||||
url = out[0].trimmed();
|
||||
url_str = out[0].trimmed();
|
||||
|
||||
if(url_str == "off")
|
||||
url.clear();
|
||||
else
|
||||
url.setUrl(url_str);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
13
src/Fossil.h
13
src/Fossil.h
@ -4,7 +4,7 @@
|
||||
class QStringList;
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include "LoggedProcess.h"
|
||||
#include "Utils.h"
|
||||
|
||||
@ -81,8 +81,8 @@ public:
|
||||
bool openRepository(const QString &repositoryPath, const QString& workspacePath);
|
||||
bool newRepository(const QString &repositoryPath);
|
||||
bool closeRepository();
|
||||
bool pushRepository();
|
||||
bool pullRepository();
|
||||
bool pushRepository(const QUrl& url);
|
||||
bool pullRepository(const QUrl& url);
|
||||
bool cloneRepository(const QString &repository, const QUrl &url, const QUrl &proxyUrl);
|
||||
bool undoRepository(QStringList& result, bool explainOnly);
|
||||
bool updateRepository(QStringList& result, const QString& revision, bool explainOnly);
|
||||
@ -103,8 +103,8 @@ public:
|
||||
bool renameFile(const QString& beforePath, const QString& afterPath, bool renameLocal);
|
||||
bool getFossilSettings(QStringList& result);
|
||||
bool setFossilSetting(const QString &name, const QString &value, bool global);
|
||||
bool setRemoteUrl(const QString &url);
|
||||
bool getRemoteUrl(QString &url);
|
||||
bool setRemoteUrl(const QUrl& url);
|
||||
bool getRemoteUrl(QUrl &url);
|
||||
|
||||
bool stashNew(const QStringList& fileList, const QString& name, bool revert);
|
||||
bool stashList(stashmap_t &stashes);
|
||||
@ -128,6 +128,8 @@ public:
|
||||
const QString &getUIHttpPort() const { return fossilUIPort; }
|
||||
QString getUIHttpAddress() const;
|
||||
|
||||
const QUrl &getDefaultRemoteUrl() const { return defaultRemoteUrl; }
|
||||
|
||||
private:
|
||||
void log(const QString &text, bool isHTML=false)
|
||||
{
|
||||
@ -144,6 +146,7 @@ private:
|
||||
QString repositoryFile;
|
||||
QString projectName;
|
||||
QString currentRevision;
|
||||
QUrl defaultRemoteUrl;
|
||||
QStringList currentTags;
|
||||
LoggedProcess fossilUI;
|
||||
QString fossilUIPort;
|
||||
|
@ -20,7 +20,6 @@ FslSettingsDialog::FslSettingsDialog(QWidget *parent, Settings &_settings) :
|
||||
ui->lineProxy->setText(settings->GetFossilValue(FOSSIL_SETTING_PROXY_URL).toString());
|
||||
|
||||
// Repository Settings
|
||||
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());
|
||||
}
|
||||
@ -47,7 +46,6 @@ void FslSettingsDialog::on_buttonBox_accepted()
|
||||
settings->SetFossilValue(FOSSIL_SETTING_GMERGE_CMD, ui->lineGMergeCommand->text());
|
||||
settings->SetFossilValue(FOSSIL_SETTING_PROXY_URL, ui->lineProxy->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());
|
||||
|
||||
|
@ -177,7 +177,12 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
|
||||
// RemotesMenu
|
||||
menuRemotes = new QMenu(this);
|
||||
menuRemotes->addAction(ui->actionPushRemote);
|
||||
menuRemotes->addAction(ui->actionPullRemote);
|
||||
menuRemotes->addAction(separator);
|
||||
menuRemotes->addAction(ui->actionAddRemote);
|
||||
menuRemotes->addAction(ui->actionEditRemote);
|
||||
menuRemotes->addAction(ui->actionSetDefaultRemote);
|
||||
|
||||
// Recent Workspaces
|
||||
// Locate a sequence of two separator actions in file menu
|
||||
@ -212,7 +217,6 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
ui->statusBar->insertPermanentWidget(1, lblTags);
|
||||
lblTags->setVisible(true);
|
||||
|
||||
|
||||
// Construct ProgressBar
|
||||
progressBar = new QProgressBar();
|
||||
progressBar->setMinimum(0);
|
||||
@ -249,7 +253,6 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
searchShortcut->setEnabled(true);
|
||||
connect(searchShortcut, SIGNAL(activated()), this, SLOT(onSearch()));
|
||||
|
||||
|
||||
// Create SearchBox
|
||||
searchBox = new SearchBox(this);
|
||||
searchBox->setPlaceholderText(tr("Find (%0)").arg(searchShortcut->key().toString()));
|
||||
@ -778,7 +781,6 @@ void MainWindow::updateWorkspaceView()
|
||||
{
|
||||
const QString &tag_name = it.key();
|
||||
|
||||
|
||||
QStandardItem *tag = new QStandardItem(getInternalIcon(":icons/icon-item-tag"), tag_name);
|
||||
tag->setData(WorkspaceItem(WorkspaceItem::TYPE_TAG, tag_name), ROLE_WORKSPACE_ITEM);
|
||||
|
||||
@ -805,21 +807,22 @@ void MainWindow::updateWorkspaceView()
|
||||
stashes->appendRow(stash);
|
||||
}
|
||||
|
||||
#if 1
|
||||
// Remotes
|
||||
QStandardItem *remotes = new QStandardItem(getInternalIcon(":icons/icon-item-remote"), tr("Remotes"));
|
||||
remotes->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTES, ""), ROLE_WORKSPACE_ITEM);
|
||||
remotes->setEditable(false);
|
||||
getWorkspace().getTreeModel().appendRow(remotes);
|
||||
{
|
||||
QStandardItem *default_url = new QStandardItem(getInternalIcon(":icons/icon-item-remote"), tr("Default"));
|
||||
QString url = settings.GetFossilValue(FOSSIL_SETTING_REMOTE_URL).toString();
|
||||
default_url->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTE, url), ROLE_WORKSPACE_ITEM);
|
||||
remotes->appendRow(default_url);
|
||||
QUrl default_url = fossil().getDefaultRemoteUrl();
|
||||
if(!default_url.isEmpty())
|
||||
{
|
||||
QUrl url = default_url;
|
||||
QStandardItem *remote_item = new QStandardItem(getInternalIcon(":icons/icon-item-remote"), url.toDisplayString());
|
||||
remote_item->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTE, default_url.toString()), ROLE_WORKSPACE_ITEM);
|
||||
remotes->appendRow(remote_item);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Expand previously selected nodes
|
||||
name_map.clear();
|
||||
BuildNameToModelIndex(name_map, getWorkspace().getTreeModel());
|
||||
@ -1353,34 +1356,6 @@ void MainWindow::on_actionOpenFile_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPush_triggered()
|
||||
{
|
||||
QString remote_url = settings.GetFossilValue(FOSSIL_SETTING_REMOTE_URL).toString();
|
||||
|
||||
if(remote_url.isEmpty() || remote_url == "off")
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("A remote repository has not been specified.\nUse the preferences window to set the remote repostory location"), QMessageBox::Ok );
|
||||
return;
|
||||
}
|
||||
|
||||
fossil().pushRepository();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPull_triggered()
|
||||
{
|
||||
QString remote_url = settings.GetFossilValue(FOSSIL_SETTING_REMOTE_URL).toString();
|
||||
|
||||
if(remote_url.isEmpty() || remote_url == "off")
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("A remote repository has not been specified.\nUse the preferences window to set the remote repostory location"), QMessageBox::Ok );
|
||||
return;
|
||||
}
|
||||
|
||||
fossil().pullRepository();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionCommit_triggered()
|
||||
{
|
||||
@ -1629,17 +1604,6 @@ void MainWindow::loadFossilSettings()
|
||||
const QString &name = it.key();
|
||||
Settings::Setting::SettingType type = it->Type;
|
||||
|
||||
// Command types we issue directly on fossil
|
||||
|
||||
if(name == FOSSIL_SETTING_REMOTE_URL)
|
||||
{
|
||||
// Retrieve existing url
|
||||
QString url;
|
||||
if(fossil().getRemoteUrl(url))
|
||||
it.value().Value = url;
|
||||
continue;
|
||||
}
|
||||
|
||||
Q_ASSERT(type == Settings::Setting::TYPE_FOSSIL_GLOBAL || type == Settings::Setting::TYPE_FOSSIL_LOCAL);
|
||||
|
||||
// Otherwise it must be a fossil setting
|
||||
@ -1685,15 +1649,6 @@ void MainWindow::on_actionFossilSettings_triggered()
|
||||
const QString &name = it.key();
|
||||
Settings::Setting::SettingType type = it.value().Type;
|
||||
|
||||
// Command types we issue directly on fossil
|
||||
// FIXME: major uglyness with settings management
|
||||
if(name == FOSSIL_SETTING_REMOTE_URL)
|
||||
{
|
||||
// Run as silent to avoid displaying credentials in the log
|
||||
fossil().setRemoteUrl(it.value().Value.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
Q_ASSERT(type == Settings::Setting::TYPE_FOSSIL_GLOBAL || type == Settings::Setting::TYPE_FOSSIL_LOCAL);
|
||||
|
||||
QString value = it.value().Value.toString();
|
||||
@ -2208,7 +2163,7 @@ void MainWindow::on_workspaceTreeView_customContextMenuRequested(const QPoint &)
|
||||
menu = menuTags;
|
||||
else if (tv.Type == WorkspaceItem::TYPE_BRANCH || tv.Type == WorkspaceItem::TYPE_BRANCHES)
|
||||
menu = menuBranches;
|
||||
else if (tv.Type == WorkspaceItem::TYPE_REMOTE)
|
||||
else if (tv.Type == WorkspaceItem::TYPE_REMOTE || tv.Type == WorkspaceItem::TYPE_REMOTES)
|
||||
menu = menuRemotes;
|
||||
|
||||
if(menu)
|
||||
@ -2514,9 +2469,120 @@ void MainWindow::on_actionEditRemote_triggered()
|
||||
if(!RemoteDialog::run(this, url))
|
||||
return;
|
||||
|
||||
if(exists)
|
||||
if(!url.isLocalFile())
|
||||
{
|
||||
if(exists)
|
||||
KeychainDelete(this, url);
|
||||
|
||||
if(!KeychainSet(this, url))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not store information to keychain."), QMessageBox::Ok );
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPushRemote_triggered()
|
||||
{
|
||||
QStringList remotes;
|
||||
getSelectionRemotes(remotes);
|
||||
if(remotes.empty())
|
||||
return;
|
||||
|
||||
QUrl url(remotes.first());
|
||||
|
||||
// Retrieve password from keychain
|
||||
if(!url.isLocalFile())
|
||||
KeychainGet(this, url);
|
||||
|
||||
fossil().pushRepository(url);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPullRemote_triggered()
|
||||
{
|
||||
QStringList remotes;
|
||||
getSelectionRemotes(remotes);
|
||||
if(remotes.empty())
|
||||
return;
|
||||
|
||||
QUrl url(remotes.first());
|
||||
|
||||
// Retrieve password from keychain
|
||||
if(!url.isLocalFile())
|
||||
KeychainGet(this, url);
|
||||
|
||||
fossil().pullRepository(url);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPush_triggered()
|
||||
{
|
||||
QUrl url = fossil().getDefaultRemoteUrl();
|
||||
|
||||
if(url.isEmpty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("A default remote repository has not been specified."), QMessageBox::Ok );
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve password from keychain
|
||||
if(!url.isLocalFile())
|
||||
KeychainGet(this, url);
|
||||
|
||||
|
||||
fossil().pushRepository(url);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionPull_triggered()
|
||||
{
|
||||
QUrl url = fossil().getDefaultRemoteUrl();
|
||||
|
||||
if(url.isEmpty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("A default remote repository has not been specified."), QMessageBox::Ok );
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve password from keychain
|
||||
if(!url.isLocalFile())
|
||||
KeychainGet(this, url);
|
||||
|
||||
fossil().pullRepository(url);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionSetDefaultRemote_triggered()
|
||||
{
|
||||
QStringList remotes;
|
||||
getSelectionRemotes(remotes);
|
||||
if(remotes.empty())
|
||||
return;
|
||||
|
||||
QUrl url(remotes.first());
|
||||
|
||||
// Retrieve password from keychain
|
||||
if(!url.isLocalFile())
|
||||
KeychainGet(this, url);
|
||||
|
||||
fossil().setRemoteUrl(url);
|
||||
updateWorkspaceView();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionAddRemote_triggered()
|
||||
{
|
||||
QUrl url;
|
||||
if(!RemoteDialog::run(this, url))
|
||||
return;
|
||||
|
||||
if(!url.isLocalFile())
|
||||
{
|
||||
KeychainDelete(this, url);
|
||||
|
||||
if(!KeychainSet(this, url))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not store information to keychain."), QMessageBox::Ok );
|
||||
if(!KeychainSet(this, url))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not store information to keychain."), QMessageBox::Ok );
|
||||
}
|
||||
|
||||
fossil().setRemoteUrl(url);
|
||||
updateWorkspaceView();
|
||||
}
|
||||
|
@ -90,6 +90,8 @@ private slots:
|
||||
void on_actionOpenFile_triggered();
|
||||
void on_actionPush_triggered();
|
||||
void on_actionPull_triggered();
|
||||
void on_actionPushRemote_triggered();
|
||||
void on_actionPullRemote_triggered();
|
||||
void on_actionCommit_triggered();
|
||||
void on_actionAdd_triggered();
|
||||
void on_actionDelete_triggered();
|
||||
@ -126,6 +128,8 @@ private slots:
|
||||
void on_actionCreateBranch_triggered();
|
||||
void on_actionMergeBranch_triggered();
|
||||
void on_actionEditRemote_triggered();
|
||||
void on_actionSetDefaultRemote_triggered();
|
||||
void on_actionAddRemote_triggered();
|
||||
|
||||
private:
|
||||
class MainWinUICallback : public UICallback
|
||||
|
@ -17,7 +17,6 @@ Settings::Settings(bool portableMode) : store(0)
|
||||
|
||||
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");
|
||||
|
@ -16,7 +16,6 @@
|
||||
#define FOSSIL_SETTING_PROXY_URL "proxy"
|
||||
#define FOSSIL_SETTING_IGNORE_GLOB "ignore-glob"
|
||||
#define FOSSIL_SETTING_CRNL_GLOB "crnl-glob"
|
||||
#define FOSSIL_SETTING_REMOTE_URL "remote-url"
|
||||
#define FOSSIL_SETTING_HTTP_PORT "http-port"
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>457</width>
|
||||
<height>266</height>
|
||||
<height>235</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -165,19 +165,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineIgnoreCRNL">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>A comma separated list of glob-style file patterns to exclude from Fossil's CR/NL consistency checking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="minimumSize">
|
||||
@ -191,8 +178,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="lineIgnore">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineIgnoreCRNL">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
@ -200,7 +187,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>A comma separated list of glob-style file/path patterns ignored in Fossil file operations</string>
|
||||
<string>A comma separated list of glob-style file patterns to exclude from Fossil's CR/NL consistency checking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -217,8 +204,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="lineRemoteURL">
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="lineIgnore">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
@ -226,22 +213,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>The remote url used to push/pull changes.
|
||||
URL style user names and passwords are also supported.
|
||||
For example http://username:password@server.com/fossil</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remote Url</string>
|
||||
<string>A comma separated list of glob-style file/path patterns ignored in Fossil file operations</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -493,7 +493,7 @@
|
||||
<string>&Push</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Push changes to the remote repository</string>
|
||||
<string>Push changes to the default remote repository</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Push changes to the remote repository</string>
|
||||
@ -511,7 +511,7 @@
|
||||
<string>Pu&ll</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pull changes from the remote repository</string>
|
||||
<string>Pull changes from the default remote repository</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Pull changes from the remote repository</string>
|
||||
@ -520,6 +520,36 @@
|
||||
<string>Ctrl+L</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPushRemote">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icon-action-push</normaloff>:/icons/icon-action-push</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Push to Remote</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Push changes to a remote repository</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Push changes to a remote repository</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPullRemote">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icon-action-pull</normaloff>:/icons/icon-action-pull</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Pu&ll from Remote</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pull changes from a remote repository</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Pull changes from a remote repository</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRename">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
@ -986,6 +1016,22 @@
|
||||
<string>Edit Remote URL</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSetDefaultRemote">
|
||||
<property name="text">
|
||||
<string>Set Remote as Default</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Makes the selected remote </string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAddRemote">
|
||||
<property name="text">
|
||||
<string>Add Remote</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Adds a Remote Url</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
Loading…
x
Reference in New Issue
Block a user