Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a configuration setting for quoting pasted urls #828

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions src/forms/propertiesdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@
<string>Behavior</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="14" column="0">
<item row="15" column="0">
<widget class="QLabel" name="label_17">
<property name="toolTip">
<string>This command will be run with an argument containing the file name of a tempfile containing the scrollback history</string>
Expand All @@ -621,7 +621,7 @@
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<item row="11" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>5</number>
Expand Down Expand Up @@ -679,7 +679,7 @@
</item>
</layout>
</item>
<item row="13" column="1">
<item row="14" column="1">
<widget class="QComboBox" name="termComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
Expand Down Expand Up @@ -718,14 +718,14 @@
<item row="2" column="1">
<widget class="QComboBox" name="motionAfterPasting_comboBox"/>
</item>
<item row="11" column="0" colspan="2">
<item row="12" column="0" colspan="2">
<widget class="QCheckBox" name="useCwdCheckBox">
<property name="text">
<string>Open new terminals in current working directory</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<item row="13" column="0" colspan="2">
<widget class="QCheckBox" name="openNewTabRightToActiveTabCheckBox">
<property name="text">
<string>Open new tab to the right of the active tab</string>
Expand All @@ -735,7 +735,7 @@
</property>
</widget>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Default $TERM</string>
Expand All @@ -749,14 +749,14 @@
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="saveSizeOnExitCheckBox">
<property name="text">
<string>Save Size when closing</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="closeTabOnMiddleClickCheckBox">
<property name="text">
<string>Close tab on middle-click</string>
Expand All @@ -766,14 +766,14 @@
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="8" column="0" colspan="2">
<widget class="QCheckBox" name="askOnExitCheckBox">
<property name="text">
<string>Ask for confirmation when closing</string>
</property>
</widget>
</item>
<item row="14" column="1">
<item row="15" column="1">
<widget class="QLineEdit" name="handleHistoryLineEdit"/>
</item>
<item row="0" column="0">
Expand All @@ -790,7 +790,14 @@
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="quotePastedUrlsCheckBox">
<property name="text">
<string>Quote pasted urls</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="savePosOnExitCheckBox">
<property name="text">
<string>Save Position when closing</string>
Expand Down
2 changes: 2 additions & 0 deletions src/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ void Properties::loadSettings()

confirmMultilinePaste = m_settings->value(QLatin1String("ConfirmMultilinePaste"), false).toBool();
trimPastedTrailingNewlines = m_settings->value(QLatin1String("TrimPastedTrailingNewlines"), false).toBool();
quotePastedUrls = m_settings->value(QLatin1String("QuotePastedUrls"), false).toBool();

windowMaximized = m_settings->value(QLatin1String("LastWindowMaximized"), false).toBool();

Expand Down Expand Up @@ -269,6 +270,7 @@ void Properties::saveSettings()

m_settings->setValue(QLatin1String("ConfirmMultilinePaste"), confirmMultilinePaste);
m_settings->setValue(QLatin1String("TrimPastedTrailingNewlines"), trimPastedTrailingNewlines);
m_settings->setValue(QLatin1String("QuotePastedUrls"), quotePastedUrls);

m_settings->setValue(QLatin1String("LastWindowMaximized"), windowMaximized);

Expand Down
1 change: 1 addition & 0 deletions src/properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Properties

bool confirmMultilinePaste;
bool trimPastedTrailingNewlines;
bool quotePastedUrls;

bool windowMaximized;

Expand Down
2 changes: 2 additions & 0 deletions src/propertiesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent)

trimPastedTrailingNewlinesCheckBox->setChecked(Properties::Instance()->trimPastedTrailingNewlines);
confirmMultilinePasteCheckBox->setChecked(Properties::Instance()->confirmMultilinePaste);
quotePastedUrlsCheckBox->setChecked(Properties::Instance()->quotePastedUrls);

// save the size on canceling too (it's saved on accepting by apply())
connect(this, &QDialog::rejected, [this] {
Expand Down Expand Up @@ -362,6 +363,7 @@ void PropertiesDialog::apply()

Properties::Instance()->trimPastedTrailingNewlines = trimPastedTrailingNewlinesCheckBox->isChecked();
Properties::Instance()->confirmMultilinePaste = confirmMultilinePasteCheckBox->isChecked();
Properties::Instance()->quotePastedUrls = quotePastedUrlsCheckBox->isChecked();

emit propertiesChanged();
}
Expand Down
1 change: 1 addition & 0 deletions src/termwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void TermWidgetImpl::propertiesChanged()
setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste);
disableBracketedPasteMode(Properties::Instance()->m_disableBracketedPasteMode);
setConfirmMultilinePaste(Properties::Instance()->confirmMultilinePaste);
setQuotePastedUrls(Properties::Instance()->quotePastedUrls);
setTrimPastedTrailingNewlines(Properties::Instance()->trimPastedTrailingNewlines);
setTerminalSizeHint(Properties::Instance()->showTerminalSizeHint);

Expand Down