diff --git a/hg/backoutdialog.h b/hg/backoutdialog.h index f9d0ba4..92afd46 100644 --- a/hg/backoutdialog.h +++ b/hg/backoutdialog.h @@ -1,78 +1,78 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HG_BACKOUT_DIALOG #define HG_BACKOUT_DIALOG #include "dialogbase.h" class QGroupBox; class QCheckBox; class QLineEdit; class HgCommitInfoWidget; /** * Implements dialog for Mercurial's backout feature. */ class HgBackoutDialog : public DialogBase { Q_OBJECT public: explicit HgBackoutDialog(QWidget *parent = 0); public slots: - void done(int r); + void done(int r) override; private slots: void saveGeometry(); void slotSelectBaseChangeset(); void slotSelectParentChangeset(); void slotUpdateOkButton(const QString &text); private: void setupUI(); /** * Find appropriate changesets in repository and show them in * Commit Selector (CommitInfoWidget) */ void loadCommits(); /** * Opens a dialog showing all changesets in a list and their respective * information when highlighted. */ QString selectChangeset(); private: QGroupBox *m_mainGroup; HgCommitInfoWidget *m_commitInfo; QPushButton *m_selectBaseCommitButton; QLineEdit *m_baseRevision; QPushButton *m_selectParentCommitButton; QLineEdit *m_parentRevision; QCheckBox *m_optMerge; }; #endif /* HG_BACKOUT_DIALOG */ diff --git a/hg/bundledialog.h b/hg/bundledialog.h index 0710869..a5319f8 100644 --- a/hg/bundledialog.h +++ b/hg/bundledialog.h @@ -1,91 +1,91 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGBUNDLEDIALOG_H #define HGBUNDLEDIALOG_H #include "dialogbase.h" class QGroupBox; class QCheckBox; class QLineEdit; class HgCommitInfoWidget; class HgPathSelector; /** * Dialog which implements bundle feature of Mercurial. Bundle enables * user to creates a file containing all the selected/desired changesets * in mercurial's internal format rather than patches. * * Changesets can either be selected by user or after being compared by * remote repository selected. * */ class HgBundleDialog : public DialogBase { Q_OBJECT public: explicit HgBundleDialog(QWidget *parent=0); public slots: - void done(int r); + void done(int r) override; private slots: void saveGeometry(); /** * Opens a dialog listing all changeset from which user will select a * changeset for base revision. */ void slotSelectChangeset(); void slotAllChangesCheckToggled(int state); private: void setupUI(); /** * Creates bundle file. * * @param fileName Path to file where bundle will be created. */ void createBundle(const QString &fileName); /** * Find all changesets in repository and show them in Commit Selector in * Base Changeset selector. */ void loadCommits(); private: QGroupBox *m_mainGroup; HgPathSelector *m_pathSelect; HgCommitInfoWidget *m_commitInfo; QPushButton *m_selectCommitButton; QLineEdit *m_baseRevision; QCheckBox *m_allChangesets; //options QGroupBox *m_optionGroup; QCheckBox *m_optForce; QCheckBox *m_optInsecure; }; #endif /* HGBUNDLEDIALOG_H */ diff --git a/hg/clonedialog.h b/hg/clonedialog.h index 8ac0d5f..00dccc2 100644 --- a/hg/clonedialog.h +++ b/hg/clonedialog.h @@ -1,92 +1,92 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGCLONEDIALOG_H #define HGCLONEDIALOG_H #include #include #include "dialogbase.h" class QLineEdit; class KPushButton; class KTextEdit; class QStackedLayout; class QCheckBox; //TODO: Enable to enter username/passwords if not found in config as well // as override within dialog /** * Implements dialog to clone repository. */ class HgCloneDialog : public DialogBase { Q_OBJECT public: explicit HgCloneDialog(const QString &directory, QWidget *parent = 0); void setWorkingDirectory(const QString &directory); private slots: void saveGeometry(); /** * Enables dialog's Ok button when user has entered some input in * source LineEdit */ void slotUpdateOkButton(); void slotBrowseDestClicked(); void slotBrowseSourceClicked(); void slotCloningStarted(); void slotCloningFinished(int exitCode, QProcess::ExitStatus); /** * Show output of clone operation in TextEdit component. */ void slotUpdateCloneOutput(); private: - void done(int r); + void done(int r) override; void browseDirectory(QLineEdit *dest); void appendOptionArguments(QStringList &args); private: QLineEdit *m_source; QLineEdit *m_destination; KPushButton *m_browse_dest; KPushButton *m_browse_source; KTextEdit *m_outputEdit; QStackedLayout *m_stackLayout; bool m_cloned; bool m_terminated; QString m_workingDirectory; QProcess m_process; // option checkboxes QCheckBox *m_optNoUpdate; QCheckBox *m_optUsePull; QCheckBox *m_optUseUncmprdTrans; QCheckBox *m_optNoVerifyServCert; }; #endif // HGCLONEDIALOG_H diff --git a/hg/commitdialog.h b/hg/commitdialog.h index 38f7fdd..ac2e64d 100644 --- a/hg/commitdialog.h +++ b/hg/commitdialog.h @@ -1,138 +1,138 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGCOMMITDIALOG_H #define HGCOMMITDIALOG_H #include "statuslist.h" #include #include "dialogbase.h" class QPlainTextEdit; class QAction; class QMenu; class QLabel; class QLineEdit; class QSplitter; namespace KTextEditor { class View; class Document; }; // TODO: Filter in HgStatusList. /** * Implements dialog for Commit changes. User is presented with a list of * changes/added/removed files, their diffs, a TextEdit to enter * commit message, options to change/create/close branch and last 5 commit * messages. */ class HgCommitDialog : public DialogBase { Q_OBJECT public: explicit HgCommitDialog(QWidget *parent = 0); private slots: /** * Shows diff of selected file in a KTextEditor widget when user selects * one of the entry in HgStatusList widget. */ void slotItemSelectionChanged(const char status, const QString &fileName); /** * Will enable 'Ok' button of dialog if some message text is available or * disables it. */ void slotMessageChanged(); void saveGeometry(); void slotBranchActions(QAction *action); /** * Shows diff of whole working directory together in KTextEditor widget. * Equivalent to plain 'hg diff' */ void slotInitDiffOutput(); void slotInsertCopyMessage(QAction *action); private: QString getParentForLabel(); void createCopyMessageMenu(); - void done(int r); + void done(int r) override; private: QString m_hgBaseDir; KTextEditor::Document *m_commitMessage; HgStatusList *m_statusList; KTextEditor::View *m_fileDiffView; KTextEditor::Document *m_fileDiffDoc; QPushButton *m_branchButton; QPushButton *m_copyMessageButton; QAction *m_closeBranch; QAction *m_newBranch; QAction *m_useCurrentBranch; QMenu *m_branchMenu; QMenu *m_copyMessageMenu; QSplitter *m_verticalSplitter; // Divides file list and editors QSplitter *m_horizontalSplitter; // Divides commit editor and diff editor /** What will commit do with branch. * * CloseBranch: Close the current branch * NewBranch : Creates new branch for this commit * NoChanges : No changes to branch are made. */ enum {CloseBranch, NewBranch, NoChanges} m_branchAction; QString m_newBranchName; }; /** * Dialog which asks for the new branch name in commit dialog */ class NewBranchDialog : public QDialog { Q_OBJECT public: explicit NewBranchDialog(QWidget *parent = 0); QString getBranchName() const; private slots: void slotTextChanged(const QString &text); private: QLabel *m_errorLabel; QLineEdit *m_branchNameInput; QStringList m_branchList; QPushButton *m_okButton; }; #endif // HGCOMMITDIALOG_H diff --git a/hg/commititemdelegate.h b/hg/commititemdelegate.h index 995b41b..339d99f 100644 --- a/hg/commititemdelegate.h +++ b/hg/commititemdelegate.h @@ -1,42 +1,42 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef COMMITITEMDELEGATE_H #define COMMITITEMDELEGATE_H #include /** * Custom Delegate to show Commit info in three lines * - Revision:Changeset (branch) * - Author * - Commit Log | First Line */ class CommitItemDelegate : public QItemDelegate { Q_OBJECT public: explicit CommitItemDelegate(QObject *parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + const QModelIndex &index) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; }; #endif // COMMITITEMDELEGATE_H diff --git a/hg/config-widgets/pluginsettings.h b/hg/config-widgets/pluginsettings.h index b9861e2..9511966 100644 --- a/hg/config-widgets/pluginsettings.h +++ b/hg/config-widgets/pluginsettings.h @@ -1,59 +1,59 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HG_PLUGIN_SETTINGS_WIDGET_H #define HG_PLUGIN_SETTINGS_WIDGET_H #include #include "hgconfig.h" class QLineEdit; class KConfig; class QPushButton; /** * Plugin Specific settings. Not those supposed to be saved in * .hgrc file, but in $HOME/.dolphin-hg */ class HgPluginSettingsWidget : public QWidget { Q_OBJECT public: explicit HgPluginSettingsWidget(QWidget *parent = 0); - virtual ~HgPluginSettingsWidget(); + ~HgPluginSettingsWidget() override; public slots: void saveConfig(); void loadConfig(); private slots: void browse_diff(); private: void setupUI(); private: QLineEdit *m_diffProg; KConfig *m_config; QPushButton *m_diffBrowseButton; }; #endif // HG_PLUGIN_SETTINGS_WIDGET_H diff --git a/hg/configdialog.h b/hg/configdialog.h index c2e8813..ea903d8 100644 --- a/hg/configdialog.h +++ b/hg/configdialog.h @@ -1,63 +1,63 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGCONFIGDIALOG_H #define HGCONFIGDIALOG_H #include "hgconfig.h" #include class HgGeneralConfigWidget; class HgPathConfigWidget; class HgIgnoreWidget; class HgPluginSettingsWidget; /** * Implements a dialog which provides an easy way to edit several * configuration options for Mercurial and the plugin. */ class HgConfigDialog : public KPageDialog { Q_OBJECT public: explicit HgConfigDialog(HgConfig::ConfigType type, QWidget *parent = 0); private: - void done(int r); + void done(int r) override; // user interface void setupUI(); private slots: void saveSettings(); void saveGeometry(); void loadGeometry(); private: HgGeneralConfigWidget *m_generalConfig; HgPathConfigWidget *m_pathConfig; HgIgnoreWidget *m_ignoreWidget; HgPluginSettingsWidget *m_pluginSetting; HgConfig::ConfigType m_configType; }; #endif // HGCONFIGDIALOG_H diff --git a/hg/createdialog.h b/hg/createdialog.h index d7f2bd2..530a8d5 100644 --- a/hg/createdialog.h +++ b/hg/createdialog.h @@ -1,51 +1,51 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGCREATEDIALOG_H #define HGCREATEDIALOG_H #include #include "dialogbase.h" class QLineEdit; class QLabel; /** * Dialog to initialize new mercurial repository */ class HgCreateDialog : public DialogBase { Q_OBJECT public: explicit HgCreateDialog(const QString &directory, QWidget *parent = 0); private: - void done(int r); + void done(int r) override; void setWorkingDirectory(const QString &directory); private: QString m_workingDirectory; QLineEdit *m_repoNameEdit; QLabel *m_directory; }; #endif // HGCREATEDIALOG_H diff --git a/hg/dialogbase.h b/hg/dialogbase.h index 046b27d..18671d1 100644 --- a/hg/dialogbase.h +++ b/hg/dialogbase.h @@ -1,68 +1,68 @@ /*************************************************************************** * Copyright (C) 2015 by Tomasz Bojczuk * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #ifndef DIALOGBASE_H #define DIALOGBASE_H #include #include #include #include /** * QDialog subclass with common method used in the plugin classes. * It has already initialized layout (@class QBoxLayout), with @p buttonBox(), * so adding other widgets/layout should be invoked by: * @p layout()->insert() to keep buttonBox at the bottom. * It also handles CTRL+Enter shortcut to accept - as old Kdialog did. */ class DialogBase : public QDialog { Q_OBJECT public: /** * Creates Dialog window with given buttons types. * But only OK and Cancel are supported so far * and available through @p okButton() and @p cancelButton() */ explicit DialogBase(QDialogButtonBox::StandardButtons buttons, QWidget* parent = 0); QPushButton* okButton() { return m_okButton; } QPushButton* cancelButton() { return m_cancelButton; } QDialogButtonBox* buttonBox() { return m_buttonBox; } /** * Layout of a dialog. By default vertical (@p QBoxLayout::TopToBottom) * Use layout()->insertLayout(0, someLaayout) or * layout()->insertWidget(0, someWidget) * to keep buttonBox at the dialog bottom. */ QBoxLayout* layout() { return m_layout; } protected: - virtual void keyReleaseEvent(QKeyEvent* event); // to handle CTRL+Enter shortcut to accept dialog + void keyReleaseEvent(QKeyEvent* event) override; // to handle CTRL+Enter shortcut to accept dialog private: QPushButton *m_okButton; QPushButton *m_cancelButton; QDialogButtonBox *m_buttonBox; QBoxLayout *m_layout; }; #endif // DIALOGBASE_H diff --git a/hg/exportdialog.h b/hg/exportdialog.h index 287283f..465bc80 100644 --- a/hg/exportdialog.h +++ b/hg/exportdialog.h @@ -1,65 +1,65 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGEXPORTDIALOG_H #define HGEXPORTDIALOG_H #include "dialogbase.h" class HgCommitInfoWidget; class QCheckBox; class QGroupBox; //TODO: Some helper for writing patterns // /** * Dialog to implement mercurial export feature. Dialogs presents list of * changesets from which the user will select entries and export a series of * patch files for each changeset. */ class HgExportDialog : public DialogBase { Q_OBJECT public: explicit HgExportDialog(QWidget *parent=0); public slots: - void done(int r); + void done(int r) override; private slots: void saveGeometry(); private: void setupUI(); void loadCommits(); private: HgCommitInfoWidget *m_commitInfoWidget; //options QGroupBox *m_optionGroup; QCheckBox *m_optText; QCheckBox *m_optGit; QCheckBox *m_optNoDates; }; #endif /* HGEXPORTDIALOG_H */ diff --git a/hg/importdialog.h b/hg/importdialog.h index 747713b..4856d43 100644 --- a/hg/importdialog.h +++ b/hg/importdialog.h @@ -1,66 +1,66 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGIMPORTDIALOG_H #define HGIMPORTDIALOG_H #include "dialogbase.h" class QListWidget; class QCheckBox; class QGroupBox; /** * Implements dialog to import changesets from patch files generated by * Mercurial's export command */ class HgImportDialog : public DialogBase { Q_OBJECT public: explicit HgImportDialog(QWidget *parent=0); public slots: - void done(int r); + void done(int r) override; private slots: void saveGeometry(); void slotAddPatches(); void slotRemovePatches(); private: void setupUI(); void getPatchInfo(const QString &fileName); private: QListWidget *m_patchList; QPushButton *m_addPatches; QPushButton *m_removePatches; //options QGroupBox *m_optionGroup; QCheckBox *m_optNoCommit; QCheckBox *m_optBypass; QCheckBox *m_optExact; QCheckBox *m_optForce; }; #endif /* HGIMPORTDIALOG_H */ diff --git a/hg/mergedialog.h b/hg/mergedialog.h index ddcbebd..4da5aea 100644 --- a/hg/mergedialog.h +++ b/hg/mergedialog.h @@ -1,52 +1,52 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGMERGEDIALOG_H #define HGMERGEDIALOG_H #include #include "dialogbase.h" class QLabel; class HgCommitInfoWidget; /** * Implements dialog to perform merge operations */ class HgMergeDialog : public DialogBase { Q_OBJECT public: explicit HgMergeDialog(QWidget *parent = 0); - void done(int r); + void done(int r) override; private slots: void saveGeometry(); private: void updateInitialDialog(); private: QLabel *m_currentChangeset; HgCommitInfoWidget *m_commitInfoWidget; }; #endif // HGMERGEDIALOG_H diff --git a/hg/pulldialog.h b/hg/pulldialog.h index 3dd0a55..97a2714 100644 --- a/hg/pulldialog.h +++ b/hg/pulldialog.h @@ -1,66 +1,66 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGPULLDIALOG_H #define HGPULLDIALOG_H #include "syncdialogbase.h" class QCheckBox; class QTableWidget; class KTextEdit; class QString; /** * Dialog to implement pull operation */ class HgPullDialog : public HgSyncBaseDialog { Q_OBJECT public: explicit HgPullDialog(QWidget *parent = 0); private: - void setOptions(); - void parseUpdateChanges(const QString &input); - void appendOptionArguments(QStringList &args); - void createChangesGroup(); - void getHgChangesArguments(QStringList &args); - void noChangesMessage(); + void setOptions() override; + void parseUpdateChanges(const QString &input) override; + void appendOptionArguments(QStringList &args) override; + void createChangesGroup() override; + void getHgChangesArguments(QStringList &args) override; + void noChangesMessage() override; private slots: void slotUpdateChangesGeometry(); - void readBigSize(); - void writeBigSize(); + void readBigSize() override; + void writeBigSize() override; private: // Options QCheckBox *m_optUpdate; QCheckBox *m_optInsecure; QCheckBox *m_optForce; QGroupBox *m_optionGroup; // incoming Changes QTableWidget *m_changesList; }; #endif // HGPULLDIALOG_H diff --git a/hg/pushdialog.h b/hg/pushdialog.h index a32a8bb..43c8eb0 100644 --- a/hg/pushdialog.h +++ b/hg/pushdialog.h @@ -1,68 +1,68 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGPUSHDIALOG_H #define HGPUSHDIALOG_H #include "hgwrapper.h" #include "syncdialogbase.h" class QCheckBox; class QTableWidget; class KTextEdit; class QGroupBox; /** * Dialog to implement Push operation */ class HgPushDialog : public HgSyncBaseDialog { Q_OBJECT public: explicit HgPushDialog(QWidget *parent = 0); private: - void setOptions(); - void createChangesGroup(); - void parseUpdateChanges(const QString &input); - void appendOptionArguments(QStringList &args); - void getHgChangesArguments(QStringList &args); - void noChangesMessage(); + void setOptions() override; + void createChangesGroup() override; + void parseUpdateChanges(const QString &input) override; + void appendOptionArguments(QStringList &args) override; + void getHgChangesArguments(QStringList &args) override; + void noChangesMessage() override; private slots: void slotOutSelChanged(); void slotUpdateChangesGeometry(); - void readBigSize(); - void writeBigSize(); + void readBigSize() override; + void writeBigSize() override; private: // Options QCheckBox *m_optAllowNewBranch; QCheckBox *m_optInsecure; QCheckBox *m_optForce; QGroupBox *m_optionGroup; // outgoing Changes QTableWidget *m_outChangesList; KTextEdit *m_changesetInfo; }; #endif // HGPUSHDIALOG_H diff --git a/hg/renamedialog.h b/hg/renamedialog.h index 4d71dd1..e0ffde3 100644 --- a/hg/renamedialog.h +++ b/hg/renamedialog.h @@ -1,52 +1,52 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGRENAMEDIALOG_H #define HGRENAMEDIALOG_H #include "dialogbase.h" #include class QLineEdit; class KFileItem; class QPushButton; /** * Dialog to rename files Mercurial way */ class HgRenameDialog : public DialogBase { Q_OBJECT public: explicit HgRenameDialog(const KFileItem &source, QWidget *parent = 0); QString source() const; QString destination() const; - void done(int r); + void done(int r) override; private slots: void slotTextChanged(const QString &text); private: QString m_source; QString m_source_dir; QLineEdit *m_destinationFile; }; #endif // HGRENAMEDIALOG_H diff --git a/hg/servewrapper.h b/hg/servewrapper.h index 4b9bd7c..52fa56e 100644 --- a/hg/servewrapper.h +++ b/hg/servewrapper.h @@ -1,170 +1,170 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HG_SERVE_WRAPPER_H #define HG_SERVE_WRAPPER_H #include #include #include #include #include class ServerProcessType; /** * Wrapper to manage web server instances of mercurial repository. More than one * server can be handled. * * This wrapper should be singleton hence only one instance should be created * and used. Hence, never create an object statically or use 'new' operator. * Use instance() method to get(create) an instance. */ class HgServeWrapper : public QObject { Q_OBJECT public: explicit HgServeWrapper(QObject *parent=0); - ~HgServeWrapper(); + ~HgServeWrapper() override; /** * Returns pointer to singleton instance of the wrapper. An instance is * created if none exists. * * @return Pointer to the instance */ static HgServeWrapper *instance(); /** * Starts a new instance of server. * * @param repoLocation Path to repository which is to be hosted on server * @param portNumber Port to create server on. * */ void startServer(const QString &repoLocation, int portNumber); /** * Stops a server. * * @param repoLocation Path to repository whose server instance in this * has to be stopped. */ void stopServer(const QString &repoLocation); /** * Checks whether a web server for given repository is running under this * wrapper. * * @param repoLocation Path to repository * @return true if running/started else false */ bool running(const QString &repoLocation); /** * Cleans all resources in this wrapper used by non-running servers */ void cleanUnused(); /** * If terminated, get error message of that server instances */ QString errorMessage(const QString &repoLocation); /** * Check if the just stopped server for given repository was * exited successfully. * * @param repoLocation Path to repository * @return true if exitCode == 0 and exitStatus == Normal, otherwise false */ bool normalExit(const QString &repoLocation); signals: // These signals are emitted for every ServerProcessType in list. Its upto // the owner of this wrapper to decide which server was updated. If any of // these signals are emitted cleanUnused() is called and every initiater // of server should check status and act according. void finished(); void error(); void started(); void readyReadLine(const QString &repoLocation, const QString &line); private: private slots: void slotFinished(int exitCode, QProcess::ExitStatus status); private: QHash m_serverList; static HgServeWrapper *m_instance; }; //FIXME: Had to change struct to class and make it unnested. // Hide member variables. /** * Represents a Mercurial Server instance. */ class ServerProcessType : public QObject { Q_OBJECT public: QProcess process; int port; ServerProcessType() { connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(slotAppendOutput())); connect(&process, SIGNAL(readyReadStandardError()), this, SLOT(slotAppendRemainingOutput())); connect(&process, QOverload::of(&QProcess::finished), this, &ServerProcessType::slotFinished); } signals: void readyReadLine(const QString &repoLocation, const QString &line); private slots: void slotAppendOutput() { if (process.canReadLine()) { emit readyReadLine(process.workingDirectory(), QTextCodec::codecForLocale()->toUnicode(process.readAllStandardOutput()).trimmed()); } } void slotAppendRemainingOutput() { emit readyReadLine(process.workingDirectory(), QTextCodec::codecForLocale()->toUnicode(process.readAllStandardError()).trimmed()); } void slotFinished() { emit readyReadLine(process.workingDirectory(), i18n("## Server Stopped! ##\n")); } }; #endif /* HG_SERVE_WRAPPER_H */ diff --git a/hg/syncdialogbase.h b/hg/syncdialogbase.h index c3ddf56..396d2ea 100644 --- a/hg/syncdialogbase.h +++ b/hg/syncdialogbase.h @@ -1,114 +1,114 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGSYNCDIALOGBASE_H #define HGSYNCDIALOGBASE_H #include "hgwrapper.h" #include #include #include #include #include "dialogbase.h" class QLabel; class QCheckBox; class QGroupBox; class QProgressBar; class QTextEdit; class QComboBox; class HgPathSelector; //TODO: Save/Load dialog geometry //TODO: HTTPS login // /** * Abstract class which implements common features of Push and Pull dialog. * Inherited by HgPushDialog and HgPullDialog. */ class HgSyncBaseDialog : public DialogBase { Q_OBJECT public: enum DialogType {PushDialog, PullDialog}; explicit HgSyncBaseDialog(DialogType dialogType, QWidget *parent = 0); signals: void changeListAvailable(); protected: - void done(int r); + void done(int r) override; void setupUI(); void createOptionGroup(); void setup(); void loadSmallSize(); void loadBigSize(); /** Changes text of @p m_optionsButton to 'Options >>' (true) or 'Options <<' (false) */ void switchOptionsButton(bool switchOn); virtual void setOptions() = 0; virtual void createChangesGroup() = 0; virtual void parseUpdateChanges(const QString &input) = 0; virtual void appendOptionArguments(QStringList &args) = 0; virtual void getHgChangesArguments(QStringList &args) = 0; virtual void noChangesMessage() = 0; protected slots: void slotGetChanges(); void slotChangesProcessComplete(int exitCode, QProcess::ExitStatus status); void slotChangesProcessError(); void slotOperationComplete(int exitCode, QProcess::ExitStatus status); void slotOperationError(); void slotUpdateBusy(QProcess::ProcessState state); void slotWriteBigSize(); void slotOptionsButtonClick(); virtual void writeBigSize() = 0; virtual void readBigSize() = 0; protected: HgPathSelector *m_pathSelector; QProgressBar *m_statusProg; bool m_haveChanges; bool m_terminated; HgWrapper *m_hgw; DialogType m_dialogType; // Options QList m_options; QGroupBox *m_optionGroup; // geometry QSize m_smallSize; QSize m_bigSize; // changes QPushButton *m_changesButton; QPushButton *m_optionsButton; QGroupBox *m_changesGroup; QProcess m_process; QProcess m_main_process; //should I use another process? }; #endif // HGSYNCDIALOGBASE_H diff --git a/hg/updatedialog.h b/hg/updatedialog.h index 57d412a..869df1f 100644 --- a/hg/updatedialog.h +++ b/hg/updatedialog.h @@ -1,57 +1,57 @@ /*************************************************************************** * Copyright (C) 2011 by Vishesh Yadav * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef HGUPDATEDIALOG_H #define HGUPDATEDIALOG_H #include #include "dialogbase.h" class KComboBox; class QLabel; class QCheckBox; /** * Dialog to update working directory to specific revision/changeset/branch/tag. * Also shows working directory summary. */ class HgUpdateDialog : public DialogBase { Q_OBJECT public: explicit HgUpdateDialog(QWidget *parent = 0); public slots: void slotUpdateDialog(int index); private: - void done(int r); + void done(int r) override; private: enum {ToBranch, ToTag, ToRevision} m_updateTo; KComboBox *m_selectType; KComboBox *m_selectFinal; QLabel *m_currentInfo; QStringList m_selectList; QCheckBox *m_discardChanges; }; #endif // HGUPDATEDIALOG_H