mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Cosmetic changes in ShareDialog
- Removed context help button. - Changed the standard dialog buttons from single buttons to buttonbox. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5792 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3a72a3032a
commit
14e3b4179a
@ -36,8 +36,8 @@
|
|||||||
#include <gui/common/GroupFlagsWidget.h>
|
#include <gui/common/GroupFlagsWidget.h>
|
||||||
|
|
||||||
/** Default constructor */
|
/** Default constructor */
|
||||||
ShareDialog::ShareDialog(std::string filename, QWidget *parent, Qt::WFlags flags)
|
ShareDialog::ShareDialog(std::string filename, QWidget *parent)
|
||||||
: QDialog(parent, flags)
|
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
|
||||||
{
|
{
|
||||||
/* Invoke Qt Designer generated QObject setup routine */
|
/* Invoke Qt Designer generated QObject setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
@ -46,10 +46,10 @@ ShareDialog::ShareDialog(std::string filename, QWidget *parent, Qt::WFlags flags
|
|||||||
ui.headerFrame->setHeaderText(tr("Share Folder"));
|
ui.headerFrame->setHeaderText(tr("Share Folder"));
|
||||||
|
|
||||||
connect(ui.browseButton, SIGNAL(clicked( bool ) ), this , SLOT( browseDirectory() ) );
|
connect(ui.browseButton, SIGNAL(clicked( bool ) ), this , SLOT( browseDirectory() ) );
|
||||||
connect(ui.okButton, SIGNAL(clicked( bool ) ), this , SLOT( addDirectory() ) );
|
connect(ui.buttonBox, SIGNAL(accepted()), this , SLOT( addDirectory() ) );
|
||||||
connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||||
|
|
||||||
ui.okButton->setEnabled(false);
|
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
|
|
||||||
QVBoxLayout *vbox = new QVBoxLayout() ;
|
QVBoxLayout *vbox = new QVBoxLayout() ;
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ ShareDialog::ShareDialog(std::string filename, QWidget *parent, Qt::WFlags flags
|
|||||||
if (it->filename == filename)
|
if (it->filename == filename)
|
||||||
{
|
{
|
||||||
/* fill dialog */
|
/* fill dialog */
|
||||||
ui.okButton->setEnabled(true);
|
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||||
|
|
||||||
ui.localpath_lineEdit->setText(QString::fromUtf8(it->filename.c_str()));
|
ui.localpath_lineEdit->setText(QString::fromUtf8(it->filename.c_str()));
|
||||||
ui.localpath_lineEdit->setDisabled(true);
|
ui.localpath_lineEdit->setDisabled(true);
|
||||||
@ -117,10 +117,10 @@ void ShareDialog::browseDirectory()
|
|||||||
|
|
||||||
/* add it to the server */
|
/* add it to the server */
|
||||||
if (qdir.isEmpty()) {
|
if (qdir.isEmpty()) {
|
||||||
ui.okButton->setEnabled(false);
|
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ui.okButton->setEnabled(true);
|
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||||
ui.localpath_lineEdit->setText(qdir);
|
ui.localpath_lineEdit->setText(qdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class ShareDialog : public QDialog
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default constructor */
|
/** Default constructor */
|
||||||
ShareDialog( std::string filename, QWidget *parent = 0, Qt::WFlags flags = 0);
|
ShareDialog( std::string filename, QWidget *parent = 0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void browseDirectory();
|
void browseDirectory();
|
||||||
|
@ -35,9 +35,6 @@
|
|||||||
<property name="lineWidth">
|
<property name="lineWidth">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<zorder>groupBox</zorder>
|
|
||||||
<zorder>frame_2</zorder>
|
|
||||||
<zorder>groupBox</zorder>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
@ -138,56 +135,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="okButton">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="minimumSize">
|
<property name="standardButtons">
|
||||||
<size>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
<width>0</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>200</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>OK</string>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="default">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="closeButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Cancel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>191</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user