diff --git a/saoritootwidget.cpp b/saoritootwidget.cpp index cc259ed..b2e518d 100644 --- a/saoritootwidget.cpp +++ b/saoritootwidget.cpp @@ -66,6 +66,22 @@ { // TODO in_reply_to_id、media_ids、sensitive…。 QString result = "status=" + ui->textEdit_toot->toPlainText().toUtf8().toPercentEncoding(); + switch (ui->comboBox_visivility->currentIndex()) { + case 0: + result += "&visibility=public"; + break; + case 1: + result += "&visibility=unlisted"; + break; + case 2: + result += "&visibility=private"; + break; + case 3: + result += "&visibility=direct"; + break; + default: + break; + } return result; } diff --git a/saoritootwidget.ui b/saoritootwidget.ui index cc807b4..f3b71e8 100644 --- a/saoritootwidget.ui +++ b/saoritootwidget.ui @@ -71,6 +71,46 @@ + + + + Public + + + + :/icons/ionicons/earth.svg:/icons/ionicons/earth.svg + + + + + Unlisted + + + + :/icons/ionicons/unlocked.svg:/icons/ionicons/unlocked.svg + + + + + Follwers only + + + + :/icons/ionicons/locked.svg:/icons/ionicons/locked.svg + + + + + Direct + + + + :/icons/ionicons/person.svg:/icons/ionicons/person.svg + + + + + Qt::NoFocus @@ -97,7 +137,9 @@ - + + + pushButton_clear diff --git a/saoriview.cpp b/saoriview.cpp index c0f43d2..2a2594b 100644 --- a/saoriview.cpp +++ b/saoriview.cpp @@ -213,7 +213,27 @@ } result += htmlDiv("media",media); + QString visibility; + QStringList vl; + vl << "public" << "unlisted" << "private" << "direct"; + switch (vl.indexOf(json["visibility"].toString())) { + case 0: + visibility = htmlImg("icon",":/icons/ionicons/earth.svg"); + break; + case 1: + visibility = htmlImg("icon",":/icons/ionicons/unlocked.svg"); + break; + case 2: + visibility = htmlImg("icon",":/icons/ionicons/locked.svg"); + break; + case 3: + visibility = htmlImg("icon",":/icons/ionicons/person.svg"); + break; + default: + break; + } result += htmlDiv("tools", + visibility + " " + htmlAnc("reply:" + json["id"].toString(), htmlImg("icon",":/icons/ionicons/reply.svg")) + " " + htmlAnc("boost:" + json["id"].toString(),