mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-29 11:56:37 -05:00
Changed direction of the new text method on GxsGroupDialog. Now the service group dialogs can set the string for the gui elements.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6063 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1c7e374fcd
commit
70e9b08bb0
8 changed files with 50 additions and 72 deletions
|
|
@ -107,19 +107,25 @@ void GxsGroupDialog::init()
|
|||
|
||||
void GxsGroupDialog::showEvent(QShowEvent*)
|
||||
{
|
||||
QString header = uiText(UITYPE_SERVICE_HEADER);
|
||||
ui.headerFrame->setHeaderText(header);
|
||||
setWindowTitle(header);
|
||||
ui.headerFrame->setHeaderImage(serviceImage());
|
||||
|
||||
QString text = uiText(UITYPE_KEY_SHARE_CHECKBOX);
|
||||
if (!text.isEmpty()) {
|
||||
ui.pubKeyShare_cb->setText(text);
|
||||
}
|
||||
initUi();
|
||||
}
|
||||
|
||||
text = uiText(UITYPE_CONTACTS_DOCK);
|
||||
if (!text.isEmpty()) {
|
||||
void GxsGroupDialog::setUiText(UiType uiType, const QString &text)
|
||||
{
|
||||
switch (uiType)
|
||||
{
|
||||
case UITYPE_SERVICE_HEADER:
|
||||
setWindowTitle(text);
|
||||
ui.headerFrame->setHeaderText(text);
|
||||
break;
|
||||
case UITYPE_KEY_SHARE_CHECKBOX:
|
||||
ui.pubKeyShare_cb->setText(text);
|
||||
break;
|
||||
case UITYPE_CONTACTS_DOCK:
|
||||
ui.contactsdockWidget->setWindowTitle(text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,9 +155,11 @@ protected slots:
|
|||
protected:
|
||||
virtual void showEvent(QShowEvent*);
|
||||
|
||||
virtual QString uiText(UiType uiType) = 0;
|
||||
virtual void initUi() = 0;
|
||||
virtual QPixmap serviceImage() = 0;
|
||||
|
||||
void setUiText(UiType uiType, const QString &text);
|
||||
|
||||
/*!
|
||||
* Main purpose is to help tansfer meta data to service
|
||||
*
|
||||
|
|
|
|||
|
|
@ -117,31 +117,23 @@ WikiGroupDialog::WikiGroupDialog(const RsWikiCollection &collection, QWidget *pa
|
|||
|
||||
}
|
||||
|
||||
QString WikiGroupDialog::uiText(UiType uiType)
|
||||
void WikiGroupDialog::initUi()
|
||||
{
|
||||
switch (uiType)
|
||||
switch (mode())
|
||||
{
|
||||
case UITYPE_SERVICE_HEADER:
|
||||
switch (mode())
|
||||
{
|
||||
case MODE_CREATE:
|
||||
return tr("Create New Wiki Group");
|
||||
case MODE_SHOW:
|
||||
return tr("Wiki Group");
|
||||
case MODE_EDIT:
|
||||
return tr("Edit Wiki Group");
|
||||
}
|
||||
case MODE_CREATE:
|
||||
setUiText(UITYPE_SERVICE_HEADER, tr("Create New Wiki Group"));
|
||||
break;
|
||||
case UITYPE_KEY_SHARE_CHECKBOX:
|
||||
return tr("Add Wiki Moderators");
|
||||
case UITYPE_CONTACTS_DOCK:
|
||||
return tr("Select Wiki Moderators");
|
||||
default:
|
||||
// remove compiler warnings
|
||||
case MODE_SHOW:
|
||||
setUiText(UITYPE_SERVICE_HEADER, tr("Wiki Group"));
|
||||
break;
|
||||
case MODE_EDIT:
|
||||
setUiText(UITYPE_SERVICE_HEADER, tr("Edit Wiki Group"));
|
||||
break;
|
||||
}
|
||||
|
||||
return "";
|
||||
setUiText(UITYPE_KEY_SHARE_CHECKBOX, tr("Add Wiki Moderators"));
|
||||
setUiText(UITYPE_CONTACTS_DOCK, tr("Select Wiki Moderators"));
|
||||
}
|
||||
|
||||
QPixmap WikiGroupDialog::serviceImage()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public:
|
|||
WikiGroupDialog(const RsWikiCollection &collection, QWidget *parent);
|
||||
|
||||
protected:
|
||||
virtual QString uiText(UiType uiType);
|
||||
virtual void initUi();
|
||||
virtual QPixmap serviceImage();
|
||||
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue