1
0
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:
agilob 2015-08-24 12:13:05 +01:00
commit 3b6d245f61
3 changed files with 47 additions and 0 deletions

View File

@ -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);
}

View File

@ -80,6 +80,7 @@ private slots:
private:
void retranslateUi();
void prFileLabelUpdate();
private:
void refreshProfiles();

View File

@ -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>&lt;p&gt;&lt;a href=&quot;file:///Dir_Path\&quot;&gt;&lt;span style=&quot; text-decoration: NONE; color:#000000;&quot;&gt;Current profile location: Dir_Path&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;</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>