Skip to content

Commit

Permalink
Format some QLabels as plain text
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and mgallien committed Dec 7, 2022
1 parent 120476e commit 135cab1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/gui/conflictdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ ConflictDialog::ConflictDialog(QWidget *parent)
_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Keep selected version"));

_ui->conflictMessage->setTextFormat(Qt::PlainText);

connect(_ui->localVersionRadio, &QCheckBox::toggled, this, &ConflictDialog::updateButtonStates);
connect(_ui->localVersionButton, &QToolButton::clicked, this, [=] {
QDesktopServices::openUrl(QUrl::fromLocalFile(_solver->localVersionFilename()));
Expand Down
2 changes: 2 additions & 0 deletions src/gui/creds/webflowcredentialsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlo
_containerLayout->setMargin(margin);

_infoLabel = new QLabel();
_infoLabel->setTextFormat(Qt::PlainText);
_infoLabel->setAlignment(Qt::AlignCenter);
_containerLayout->addWidget(_infoLabel);

Expand Down Expand Up @@ -65,6 +66,7 @@ WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlo
connect(app, &Application::isShowingSettingsDialog, this, &WebFlowCredentialsDialog::slotShowSettingsDialog);

_errorLabel = new QLabel();
_errorLabel->setTextFormat(Qt::PlainText);
_errorLabel->hide();
_containerLayout->addWidget(_errorLabel);

Expand Down
3 changes: 3 additions & 0 deletions src/gui/invalidfilenamedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ InvalidFilenameDialog::InvalidFilenameDialog(AccountPtr account, Folder *folder,
_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Rename file"));

_ui->descriptionLabel->setTextFormat(Qt::PlainText);
_ui->errorLabel->setTextFormat(Qt::PlainText);

_ui->descriptionLabel->setText(tr("The file \"%1\" could not be synced because the name contains characters which are not allowed on this system.").arg(_originalFileName));
_ui->explanationLabel->setText(tr("The following characters are not allowed on the system: * \" | & ? , ; : \\ / ~ < > leading/trailing spaces"));
_ui->filenameLineEdit->setText(filePathFileInfo.fileName());
Expand Down
14 changes: 13 additions & 1 deletion src/gui/invalidfilenamedialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>411</width>
<width>607</width>
<height>192</height>
</rect>
</property>
Expand All @@ -22,6 +22,9 @@
<property name="text">
<string>The file could not be synced because it contains characters which are not allowed on this system.</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
Expand All @@ -35,6 +38,9 @@
<property name="text">
<string>Error</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
Expand All @@ -48,6 +54,9 @@
<property name="text">
<string>Please enter a new name for the file:</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
Expand Down Expand Up @@ -105,6 +114,9 @@
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>
Expand Down
5 changes: 5 additions & 0 deletions src/gui/wizard/owncloudadvancedsetuppage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard)
_filePathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
_ui.locationsGridLayout->addWidget(_filePathLabel.data(), 3, 3);

_filePathLabel->setTextFormat(Qt::PlainText);
_ui.userNameLabel->setTextFormat(Qt::PlainText);
_ui.serverAddressLabel->setTextFormat(Qt::PlainText);
_ui.localFolderDescriptionLabel->setTextFormat(Qt::PlainText);

registerField(QLatin1String("OCSyncFromScratch"), _ui.cbSyncFromScratch);

auto sizePolicy = _progressIndi->sizePolicy();
Expand Down
34 changes: 29 additions & 5 deletions src/gui/wizard/owncloudadvancedsetuppage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<string notr="true">TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand All @@ -57,6 +57,9 @@
<property name="text">
<string notr="true">Avatar</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -73,6 +76,9 @@
<property name="text">
<string>&amp;Local Folder</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -85,13 +91,15 @@
<widget class="QLabel" name="userNameLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Username</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -101,13 +109,15 @@
<widget class="QLabel" name="localFolderDescriptionLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Local Folder</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand Down Expand Up @@ -143,6 +153,9 @@
<property name="text">
<string notr="true">Free space</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand Down Expand Up @@ -214,6 +227,9 @@
<property name="text">
<string>Server address</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
Expand All @@ -227,6 +243,9 @@
<property name="text">
<string>Sync Logo</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand Down Expand Up @@ -366,6 +385,9 @@
<property name="text">
<string extracomment="Trailing part of &quot;Ask confirmation before syncing folder larger than&quot; ">MB</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -558,7 +580,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down Expand Up @@ -639,6 +660,9 @@
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>
Expand All @@ -647,7 +671,7 @@
<string notr="true">TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
Expand Down

0 comments on commit 135cab1

Please sign in to comment.