Skip to content

Commit

Permalink
Remove always use media-col setting
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Jul 31, 2021
1 parent ebdfa9e commit a4168ef
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 94 deletions.
7 changes: 0 additions & 7 deletions qml/harbour-seaprint.qml
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ ApplicationWindow
defaultValue: true
}

ConfigurationValue
{
id: alwaysUseMediaColSetting
key: SeaPrintSettings.alwaysUseMediaColPath
defaultValue: SeaPrintSettings.alwaysUseMediaColDefault
}

ConfigurationValue
{
id: ignoreSslErrorsSetting
Expand Down
9 changes: 0 additions & 9 deletions qml/pages/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ Page {
}
}

TextSwitch {
text: qsTr("Always use media-col")
description: qsTr("Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.")
checked: alwaysUseMediaColSetting.value
onCheckedChanged: {
alwaysUseMediaColSetting.value = checked
}
}

TextSwitch {
text: qsTr("Ignore SSL errors")
description: qsTr("In order to work with self-signed certificates of printers and CUPS instances, SSL errors needs to be ignored.")
Expand Down
3 changes: 1 addition & 2 deletions src/ippprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,8 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename)
o.insert("job-name", QJsonObject {{"tag", IppMsg::NameWithoutLanguage}, {"value", fileinfo.fileName()}});

QString PaperSize = getAttrOrDefault(jobAttrs, "media").toString();
bool alwaysUseMediaCol = Settings::instance()->alwaysUseMediaCol();

if((jobAttrs.contains("media-col") || alwaysUseMediaCol) && jobAttrs.contains("media"))
if(jobAttrs.contains("media-col") && jobAttrs.contains("media"))
{
qDebug() << "moving media to media-col" << PaperSize;
if(!PaperSizes.contains(PaperSize))
Expand Down
15 changes: 1 addition & 14 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#include <QMutex>


Settings::Settings() : _alwaysUseMediaColSetting("/apps/harbour-seaprint/settings/always-use-media-col", this),
_ignoreSslErrorsSetting("/apps/harbour-seaprint/settings/ignore-ssl-errors", this)
Settings::Settings() : _ignoreSslErrorsSetting("/apps/harbour-seaprint/settings/ignore-ssl-errors", this)
{

}
Expand All @@ -29,23 +28,11 @@ Settings* Settings::instance()
return m_Instance;
}


bool Settings::alwaysUseMediaCol()
{
return _alwaysUseMediaColSetting.value(_alwaysUseMediaColDefault).toBool();
}

bool Settings::ignoreSslErrors()
{
return _ignoreSslErrorsSetting.value(_ignoreSslErrorsDefault).toBool();
}


QString Settings::alwaysUseMediaColPath()
{
return _alwaysUseMediaColSetting.key();
}

QString Settings::ignoreSslErrorsPath()
{
return _ignoreSslErrorsSetting.key();
Expand Down
6 changes: 0 additions & 6 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ class Settings : public QObject
{
Q_OBJECT
public:
Q_PROPERTY(QString alwaysUseMediaColPath READ alwaysUseMediaColPath CONSTANT)
Q_PROPERTY(bool alwaysUseMediaColDefault MEMBER _alwaysUseMediaColDefault CONSTANT)

Q_PROPERTY(QString ignoreSslErrorsPath READ ignoreSslErrorsPath CONSTANT)
Q_PROPERTY(bool ignoreSslErrorsDefault MEMBER _ignoreSslErrorsDefault CONSTANT)

public:
static Settings* instance();

bool alwaysUseMediaCol();
bool ignoreSslErrors();

private:
Expand All @@ -27,13 +24,10 @@ class Settings : public QObject

static Settings* m_Instance;

MGConfItem _alwaysUseMediaColSetting;
MGConfItem _ignoreSslErrorsSetting;

QString alwaysUseMediaColPath();
QString ignoreSslErrorsPath();

bool _alwaysUseMediaColDefault = false;
bool _ignoreSslErrorsDefault = true;
};

Expand Down
8 changes: 0 additions & 8 deletions translations/harbour-seaprint-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,6 @@
<source>Display the warning page about optional dependencies not being installed, if they are not installed.</source>
<translation>Warnseite über nicht installierte optionalen Abhängigkeiten anzeigen, wenn diese nicht installiert sind.</translation>
</message>
<message>
<source>Always use media-col</source>
<translation>Immer media-col nutzen</translation>
</message>
<message>
<source>Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.</source>
<translation>Das Attribut media-col anstelle des Papierformats benutzen. Das bedeutet, dass eine Auswahl über Parameter anstatt eines Namens erfolgt. Wenn keine Seitenränder aktiviert sind, wird unabhängig von der Einstellung die Parameter Auswahl benutzt.</translation>
</message>
<message>
<source>Settings</source>
<translation>Einstellungen</translation>
Expand Down
8 changes: 0 additions & 8 deletions translations/harbour-seaprint-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,6 @@
<source>Display the warning page about optional dependencies not being installed, if they are not installed.</source>
<translation>Mostrar página de advertencia sobre las dependencias opcionales no instaladas cuando no están instaladas.</translation>
</message>
<message>
<source>Always use media-col</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Settings</source>
<translation type="unfinished">Ajustes</translation>
Expand Down
8 changes: 0 additions & 8 deletions translations/harbour-seaprint-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,6 @@
<source>Display the warning page about optional dependencies not being installed, if they are not installed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Always use media-col</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Settings</source>
<translation>Paramètres</translation>
Expand Down
8 changes: 0 additions & 8 deletions translations/harbour-seaprint-nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,6 @@
<source>Display the warning page about optional dependencies not being installed, if they are not installed.</source>
<translation>Waarschuwingspagina weergeven over optionele afhankelijkheden die niet worden geïnstalleerd, als ze niet zijn geïnstalleerd.</translation>
</message>
<message>
<source>Always use media-col</source>
<translation>Altijd media-col gebruiken</translation>
</message>
<message>
<source>Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.</source>
<translation>Het kenmerk media-col gebruiken in plaats van media voor papierformaten. D.w.z. parametrische selectie maken van gedrukte media in plaats van op naam. Als u geen afdrukmarges gebruikt, wordt parametrische selectie gebruikt, ongeacht deze instelling.</translation>
</message>
<message>
<source>Settings</source>
<translation>Instellingen</translation>
Expand Down
8 changes: 0 additions & 8 deletions translations/harbour-seaprint-pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,6 @@
<source>Some printers support more formats than they advertise correctly. However, additional formats can be inferred from other attributes. Mainly relevant for Postscript-compatible printers that also support PDF.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Always use media-col</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ignore SSL errors</source>
<translation type="unfinished"></translation>
Expand Down
8 changes: 0 additions & 8 deletions translations/harbour-seaprint-zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,6 @@
<source>Display the warning page about optional dependencies not being installed, if they are not installed.</source>
<translation>如果没有安装可选的依赖程序,则显示警告页面。</translation>
</message>
<message>
<source>Always use media-col</source>
<translation>总是使用media-col</translation>
</message>
<message>
<source>Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.</source>
<translation>纸张尺寸使用特性 media-col 而不是 media 。即对打印介质进行参数化选择,而不是按名称选择。 如果您使用零打印页边距,则无论此设置如何,都将使用参数选择。</translation>
</message>
<message>
<source>Settings</source>
<translation>设置</translation>
Expand Down
8 changes: 0 additions & 8 deletions translations/harbour-seaprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,6 @@
<source>Display the warning page about optional dependencies not being installed, if they are not installed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Always use media-col</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use the attribute media-col instead of media for paper sizes. I.e. do parametric selection of print media rather than by name. If you use zero print margins, parametric selection will be used regardless of this setting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Settings</source>
<translation type="unfinished"></translation>
Expand Down

0 comments on commit a4168ef

Please sign in to comment.