Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Updated feedback from design and added filesize check and error notic…
Browse files Browse the repository at this point in the history
…es (linux), #2444
  • Loading branch information
IndrekV committed May 11, 2018
1 parent 3293d09 commit 31d30c2
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 13 deletions.
8 changes: 8 additions & 0 deletions src/ui/linux/TogglDesktop/feedbackdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,20 @@ void FeedbackDialog::on_uploadImageButton_clicked() {
void FeedbackDialog::on_sendButton_clicked() {
QString content = ui->content->toPlainText();
if (content.isEmpty()) {
QMessageBox(QMessageBox::Information,
"Feedback not sent!",
"Please type in your feedback before sending.",
QMessageBox::Ok).exec();
ui->content->setFocus();
return;
}
if (!TogglApi::instance->sendFeedback(ui->topic->currentText(),
ui->content->toPlainText(),
path)) {
QMessageBox(QMessageBox::Information,
"Feedback not sent!",
"Please check that file you are sending is not larger than 5MB.",
QMessageBox::Ok).exec();
return;
}
ui->topic->setCurrentIndex(0);
Expand Down
74 changes: 61 additions & 13 deletions src/ui/linux/TogglDesktop/feedbackdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,30 @@
<widget class="QTextEdit" name="content"/>
</item>
<item>
<widget class="QLabel" name="selectedImageFilename">
<property name="text">
<string>(no image selected)</string>
<widget class="QWidget" name="fileRow" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="uploadImageButton">
<widget class="QLabel" name="selectedImageFilename">
<property name="text">
<string>Upload image</string>
</property>
<property name="autoDefault">
<bool>false</bool>
<string>(maximum image size 5MB)</string>
</property>
</widget>
</item>
Expand All @@ -68,7 +76,47 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="uploadImageButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Upload image</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="sendButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Send</string>
</property>
Expand Down

0 comments on commit 31d30c2

Please sign in to comment.