aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2013-07-23 08:56:56 +0000
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2013-07-23 08:56:56 +0000
commit81a0f6d2d7350e8fba08cb200160a071963fae86 (patch)
tree17b2deee3c1666f1b073ae1bdfb460ba217bcd39 /ui
parent8c5f14a44017f7e239d6e89a6d1cf5f9cc4d121c (diff)
From Thomas ERSFELD (GSoC13) via remark of Gerald Use QDialogButtonBox for Summary Dialog
(Using a QDialogButtonBox would ensure that the button names, sizes, and placement conforms to the UI guidelines for each platform.) svn path=/trunk/; revision=50822
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/summary_dialog.cpp17
-rw-r--r--ui/qt/summary_dialog.h11
-rw-r--r--ui/qt/summary_dialog.ui36
3 files changed, 28 insertions, 36 deletions
diff --git a/ui/qt/summary_dialog.cpp b/ui/qt/summary_dialog.cpp
index 38be1edeb6..12811f9cce 100644
--- a/ui/qt/summary_dialog.cpp
+++ b/ui/qt/summary_dialog.cpp
@@ -59,18 +59,27 @@ SummaryDialog::SummaryDialog(QWidget *parent) :
ui->tbDisplay->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Stretch);
#endif
this->setFixedSize(this->size());
+
+ connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(SaveComment()));
+ connect(ui->buttonBox, SIGNAL(helpRequested()), this, SLOT(HelpButton()));
+
+ bRefresh = ui->buttonBox->addButton(tr("Refresh"), QDialogButtonBox::ActionRole);
+ connect(bRefresh, SIGNAL(clicked()), this, SLOT(RefreshData()));
+
+ bCopyComment = ui->buttonBox->addButton(tr("Copy To Clipboard"), QDialogButtonBox::ActionRole);
+ connect(bCopyComment, SIGNAL(clicked()), this, SLOT(CopyComment()));
}
/*
* Slots
**/
-void SummaryDialog::on_bRefresh_clicked()
+void SummaryDialog::RefreshData()
{
UpdateValues();
}
-void SummaryDialog::on_bSaveComments_clicked()
+void SummaryDialog::SaveComment()
{
if (cfile.filename != NULL)
{
@@ -83,12 +92,12 @@ void SummaryDialog::on_bSaveComments_clicked()
}
}
-void SummaryDialog::on_bHelpButton_clicked()
+void SummaryDialog::HelpButton()
{
wsApp->helpTopicAction(HELP_STATS_SUMMARY_DIALOG);
}
-void SummaryDialog::on_bCopyComment_clicked()
+void SummaryDialog::CopyComment()
{
QClipboard *clipboard = QApplication::clipboard();
diff --git a/ui/qt/summary_dialog.h b/ui/qt/summary_dialog.h
index 38e1cf52f3..e7847b5fa6 100644
--- a/ui/qt/summary_dialog.h
+++ b/ui/qt/summary_dialog.h
@@ -74,16 +74,19 @@ signals:
protected slots:
- void on_bRefresh_clicked();
- void on_bSaveComments_clicked();
- void on_bHelpButton_clicked();
- void on_bCopyComment_clicked();
+ void RefreshData();
+ void SaveComment();
+ void HelpButton();
+ void CopyComment();
void on_tabWidget_currentChanged(int index);
private:
Ui::SummaryDialog *ui;
+ QPushButton *bRefresh;
+ QPushButton *bCopyComment;
+
summary_tally summary_;
};
diff --git a/ui/qt/summary_dialog.ui b/ui/qt/summary_dialog.ui
index a55324b5f0..ffc520e0a3 100644
--- a/ui/qt/summary_dialog.ui
+++ b/ui/qt/summary_dialog.ui
@@ -60,7 +60,7 @@
<x>21</x>
<y>21</y>
<width>731</width>
- <height>80</height>
+ <height>88</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@@ -240,7 +240,7 @@
<x>21</x>
<y>18</y>
<width>731</width>
- <height>38</height>
+ <height>42</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_4">
@@ -390,7 +390,7 @@
<x>30</x>
<y>170</y>
<width>731</width>
- <height>38</height>
+ <height>42</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_3">
@@ -444,38 +444,18 @@
</widget>
</widget>
</widget>
- <widget class="QSplitter" name="splitter">
+ <widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
- <x>20</x>
+ <x>10</x>
<y>550</y>
- <width>771</width>
+ <width>781</width>
<height>23</height>
</rect>
</property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Help|QDialogButtonBox::Save</set>
</property>
- <widget class="QPushButton" name="bRefresh">
- <property name="text">
- <string>Refresh</string>
- </property>
- </widget>
- <widget class="QPushButton" name="bSaveComments">
- <property name="text">
- <string>Save </string>
- </property>
- </widget>
- <widget class="QPushButton" name="bHelpButton">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- <widget class="QPushButton" name="bCopyComment">
- <property name="text">
- <string>Copy to clipboard</string>
- </property>
- </widget>
</widget>
</widget>
<resources>