diff --git a/manifest b/manifest index fef661d..0b81bc0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reorganized\sbranch\soptions\sin\scommit\sdialog. -D 2015-06-02T16:19:59.488 +C Initial\swork\son\suser\sdefined\sfile\sactions\n +D 2015-06-02T17:28:10.948 F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b @@ -224,18 +224,18 @@ F src/FslSettingsDialog.cpp 2531d3709f0eab66651671e3edead2ca720d07d5 F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7 F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 -F src/MainWindow.cpp 191dff3e4759644be48ce40048d6f93d3a5e03f2 -F src/MainWindow.h 31870bca434835471159ab350583c21028e77e47 +F src/MainWindow.cpp 8521536cfe2167d5b82bc5c7808dff8117d3da4f +F src/MainWindow.h d3216b30702df9a44b3a93e6c96fd05ceb0e3822 F src/RemoteDialog.cpp 8540cc5e2e41c4127ed8a028d84691604fa6ecac F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d F src/RevisionDialog.cpp e58c4f8a704f00addebb15d521b76620fdafda79 F src/RevisionDialog.h b718c3009342eaabad39c8a11a253a4e4fef7a73 F src/SearchBox.cpp d4209c575baa9933e1ce5ed376e785b289a145ba F src/SearchBox.h 0c78d3a68136dab3e0e71b83ae36f22bd2688ab2 -F src/Settings.cpp 7a674604caa9d9f5ffb6b73d95745bde09525389 -F src/Settings.h 883ac5c0f38a6ac93b400b7b96447b017ee50c06 -F src/SettingsDialog.cpp 25be4c351dd21ea9132321944f42dc0bc22fb128 -F src/SettingsDialog.h b324dfd77ca3ad24fd83588aaf79a7e4c291e716 +F src/Settings.cpp 8e8c85f2c2aecb6df3d456ce775a4a53704ebbed +F src/Settings.h 9eeeec1ac9cee4d8dc44a448995d0d599274c2ff +F src/SettingsDialog.cpp 611405e28ce746b2db6ff210c2784d5b8f2dbde8 +F src/SettingsDialog.h fea64d7f92ff326ea49f14559e36379892c0a7c4 F src/Utils.cpp d53b1b92352e586a7c12a19ec6b109a9f095b7f1 F src/Utils.h 011e4be3f94cd26be537299cd44ab9c135db44a5 F src/Workspace.cpp 7004c2c30f79d2e64691aa9b2c55ee72a84d978b @@ -248,11 +248,14 @@ F ui/CloneDialog.ui 4886e7d4f258ea8b852b5eefc860396e35145712 F ui/CommitDialog.ui 1e5dafa742e9ae07ec937bcda8cda3297ddc6199 F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d F ui/FslSettingsDialog.ui eb3d4cb764cab90b01e82922237d8c42d6ce1749 -F ui/MainWindow.ui 10181826a25056ed5aba2b23a7d110159be7c043 +F ui/MainWindow.ui 140d5b3e8c37d2e764afd3ee9e74bc754888d067 F ui/RemoteDialog.ui 95a4750d972ed8c49bb10b95db91ff16cfe2dd0b F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd -F ui/SettingsDialog.ui 4c480cd595a32664d01c85bf74845c4282fc0068 -P 4e621933a5ddf87127fab8cc0aa94a4a6fd8c964 -R 176bdc576cc4d16d2dc819b4b903879d +F ui/SettingsDialog.ui 2a84288694c666badb6f29e4badaa3f0bdd46287 +P 1954aea71218df9a36b6059fac19ab416ef470dc +R e725cdba0f62a2aad3ff979a23275b03 +T *branch * user-actions +T *sym-user-actions * +T -sym-trunk * U kostas -Z d1ca8b7e2dcce6bdcdbdb07bc1f60316 +Z 732d3b0fa352093eb465015746a344aa diff --git a/manifest.uuid b/manifest.uuid index 67808eb..6ce7e81 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1954aea71218df9a36b6059fac19ab416ef470dc \ No newline at end of file +c1562dbda3ad33559227bb0d2fd177e35cae6681 \ No newline at end of file diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 337f0ab..238d5c8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -106,11 +106,14 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP ui->fileTableView->addAction(ui->actionHistory); ui->fileTableView->addAction(ui->actionOpenFile); ui->fileTableView->addAction(ui->actionOpenContaining); + ui->actionCustomFileAction->setVisible(false); + ui->fileTableView->addAction(ui->actionCustomFileAction); ui->fileTableView->addAction(separator); ui->fileTableView->addAction(ui->actionAdd); ui->fileTableView->addAction(ui->actionRevert); ui->fileTableView->addAction(ui->actionRename); ui->fileTableView->addAction(ui->actionDelete); + connect( ui->fileTableView, SIGNAL( dragOutEvent() ), SLOT( onFileViewDragOut() ), @@ -604,7 +607,8 @@ void MainWindow::enableActions(bool on) ui->actionDeleteTag, ui->actionCreateBranch, ui->actionMergeBranch, - ui->actionFossilSettings + ui->actionFossilSettings, + ui->actionCustomFileAction }; for(size_t i=0; iactionCustomFileAction->setVisible(true); + ui->actionCustomFileAction->setText(fileaction_name); + } + else + ui->actionCustomFileAction->setVisible(false); +} + +//------------------------------------------------------------------------------ +void MainWindow::on_actionCustomFileAction_triggered() +{ + if(!settings.HasValue(FUEL_SETTING_FILEACTION_NAME) || !settings.HasValue(FUEL_SETTING_FILEACTION_COMMAND)) + return; + + QStringList selection; + getSelectionFilenames(selection, WorkspaceFile::TYPE_ALL); + + QProcess proc(this); + + QStringList params; + foreach(const QString &f, selection) + { + QString path = QFileInfo(fossil().getCurrentWorkspace() + "/" + f).absoluteFilePath(); + params.append(path); + } + + const QString &cmd = settings.GetValue(FUEL_SETTING_FILEACTION_COMMAND).toString(); + proc.startDetached(cmd, params); +} diff --git a/src/MainWindow.h b/src/MainWindow.h index cbdf458..bde410d 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -52,7 +52,9 @@ private: void updateWorkspaceView(); void updateFileView(); void selectRootDir(); - void MergeRevision(const QString& defaultRevision); + void mergeRevision(const QString& defaultRevision); + void applyUserActions(); + void fossilBrowse(const QString &fossilUrl); void dragEnterEvent(class QDragEnterEvent *event); @@ -132,6 +134,7 @@ private slots: void on_actionSetDefaultRemote_triggered(); void on_actionAddRemote_triggered(); void on_actionDeleteRemote_triggered(); + void on_actionCustomFileAction_triggered(); private: class MainWinUICallback : public UICallback diff --git a/src/Settings.cpp b/src/Settings.cpp index 1a88187..5c35c26 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -37,6 +37,11 @@ Settings::Settings(bool portableMode) : store(0) if(!HasValue(FUEL_SETTING_WEB_BROWSER)) SetValue(FUEL_SETTING_WEB_BROWSER, 0); + if(!HasValue(FUEL_SETTING_FILEACTION_NAME)) + SetValue(FUEL_SETTING_FILEACTION_NAME, ""); + if(!HasValue(FUEL_SETTING_FILEACTION_COMMAND)) + SetValue(FUEL_SETTING_FILEACTION_COMMAND, ""); + ApplyEnvironment(); } diff --git a/src/Settings.h b/src/Settings.h index 3153868..fd16b09 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -10,6 +10,8 @@ #define FUEL_SETTING_FILE_DBLCLICK "FileDblClickAction" #define FUEL_SETTING_LANGUAGE "Language" #define FUEL_SETTING_WEB_BROWSER "WebBrowser" +#define FUEL_SETTING_FILEACTION_NAME "FileActionName" +#define FUEL_SETTING_FILEACTION_COMMAND "FileActionCommand" #define FOSSIL_SETTING_GDIFF_CMD "gdiff-command" #define FOSSIL_SETTING_GMERGE_CMD "gmerge-command" diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index 59b86d7..c2e92f2 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -26,6 +26,9 @@ SettingsDialog::SettingsDialog(QWidget *parent, Settings &_settings) : ui->cmbDoubleClickAction->setCurrentIndex(settings->GetValue(FUEL_SETTING_FILE_DBLCLICK).toInt()); ui->cmbFossilBrowser->setCurrentIndex(settings->GetValue(FUEL_SETTING_WEB_BROWSER).toInt()); + ui->lineCustomFileActionName->setText(settings->GetValue(FUEL_SETTING_FILEACTION_NAME).toString()); + ui->lineCustomFileActionCommand->setText(settings->GetValue(FUEL_SETTING_FILEACTION_COMMAND).toString()); + // Initialize language combo foreach(const LangMap &m, langMap) ui->cmbActiveLanguage->addItem(m.name); @@ -68,6 +71,12 @@ void SettingsDialog::on_buttonBox_accepted() if(curr_langid != new_langid) QMessageBox::information(this, tr("Restart required"), tr("The language change will take effect after restarting the application"), QMessageBox::Ok); + + Q_ASSERT(settings->HasValue(FUEL_SETTING_FILEACTION_NAME)); + settings->SetValue(FUEL_SETTING_FILEACTION_NAME, ui->lineCustomFileActionName->text().trimmed()); + Q_ASSERT(settings->HasValue(FUEL_SETTING_FILEACTION_COMMAND)); + settings->SetValue(FUEL_SETTING_FILEACTION_COMMAND, QDir::fromNativeSeparators(ui->lineCustomFileActionCommand->text().trimmed())); + settings->ApplyEnvironment(); } @@ -121,3 +130,11 @@ QString SettingsDialog::LangNameToId(const QString &name) return ""; } + +//----------------------------------------------------------------------------- +void SettingsDialog::on_btnSelectCustomFileActionCommand_clicked() +{ + QString path = SelectExe(this, tr("Select executable")); + if(!path.isEmpty()) + ui->lineCustomFileActionCommand->setText(QDir::toNativeSeparators(path)); +} diff --git a/src/SettingsDialog.h b/src/SettingsDialog.h index 418f2ea..5eef6a6 100644 --- a/src/SettingsDialog.h +++ b/src/SettingsDialog.h @@ -23,6 +23,7 @@ private slots: void on_btnSelectFossil_clicked(); void on_buttonBox_accepted(); void on_btnClearMessageHistory_clicked(); + void on_btnSelectCustomFileActionCommand_clicked(); private: QString LangIdToName(const QString &id); diff --git a/ui/MainWindow.ui b/ui/MainWindow.ui index 9607069..a4043e0 100644 --- a/ui/MainWindow.ui +++ b/ui/MainWindow.ui @@ -1047,6 +1047,14 @@ Delete Remote + + + Custom File Action + + + Custom File Action + + diff --git a/ui/SettingsDialog.ui b/ui/SettingsDialog.ui index 0685355..ae0116d 100644 --- a/ui/SettingsDialog.ui +++ b/ui/SettingsDialog.ui @@ -10,7 +10,7 @@ 0 0 457 - 204 + 278 @@ -180,6 +180,69 @@ + + + + + 100 + 0 + + + + Custom File Action Name + + + + + + + Name of custom action + + + + + + + + 100 + 0 + + + + Custom File Action Command + + + + + + + + + Custom action command line + + + + + + + + 0 + 0 + + + + + 24 + 24 + + + + ... + + + + +