mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge remote-tracking branch 'PKEv/add_profileFileName_in_profilePage'
fix #1951
This commit is contained in:
commit
3b6d245f61
|
@ -120,6 +120,12 @@ ProfileForm::ProfileForm(QWidget *parent) :
|
|||
Translator::registerHandler(std::bind(&ProfileForm::retranslateUi, this), this);
|
||||
}
|
||||
|
||||
void ProfileForm::prFileLabelUpdate()
|
||||
{
|
||||
Nexus& nexus = Nexus::getInstance();
|
||||
bodyUI->prFileLabel->setText(tr("Current profile:") + nexus.getProfile()->getName() + ".tox");
|
||||
}
|
||||
|
||||
ProfileForm::~ProfileForm()
|
||||
{
|
||||
Translator::unregister(this);
|
||||
|
@ -134,6 +140,11 @@ void ProfileForm::show(Ui::MainWindow &ui)
|
|||
ui.mainContent->layout()->addWidget(this);
|
||||
head->show();
|
||||
QWidget::show();
|
||||
prFileLabelUpdate();
|
||||
QString DirPath = QDir(Settings::getInstance().getSettingsDirPath()).path().trimmed();
|
||||
bodyUI->dirPrLink->setText(bodyUI->dirPrLink->text().replace("Dir_Path",DirPath));
|
||||
bodyUI->dirPrLink->setOpenExternalLinks(true);
|
||||
bodyUI->dirPrLink->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::TextSelectableByMouse);
|
||||
bodyUI->userName->setFocus();
|
||||
bodyUI->userName->selectAll();
|
||||
}
|
||||
|
@ -260,7 +271,10 @@ void ProfileForm::onRenameClicked()
|
|||
GUI::showError(tr("Failed to rename", "rename failed title"),
|
||||
tr("Couldn't rename the profile to \"%1\"").arg(cur));
|
||||
else
|
||||
{
|
||||
prFileLabelUpdate();
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ private slots:
|
|||
|
||||
private:
|
||||
void retranslateUi();
|
||||
void prFileLabelUpdate();
|
||||
|
||||
private:
|
||||
void refreshProfiles();
|
||||
|
|
|
@ -155,6 +155,38 @@ Share it with your friends to communicate.</string>
|
|||
<string>Profile</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="profilesVLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="prFileLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="dirPrLink">
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><p><a href="file:///Dir_Path\"><span style=" text-decoration: NONE; color:#000000;">Current profile location: Dir_Path</span></a></p></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="profilesButtonsLayout">
|
||||
<item>
|
||||
|
|
Loading…
Reference in New Issue
Block a user