Skip to content

Commit

Permalink
Ajout d'un bouton pour l'attachement d'un fichier
Browse files Browse the repository at this point in the history
  • Loading branch information
dguihal@gmail.com committed Mar 21, 2014
1 parent f23bd5f commit 000d645
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
Binary file added rc/attach.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions rc/quteqoin_img.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<file>settings-icon.png</file>
<file>delete-icon.png</file>
<file>hunt-icon.png</file>
<file>attach.png</file>
</qresource>
</RCC>
6 changes: 3 additions & 3 deletions ui/palmipede/qqpalmilineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ void QQPalmiLineEdit::underline()


//////////////////////////////////////////////////////////////
/// \brief QQPalmiLineEdit::joinFile
/// \brief QQPalmiLineEdit::attachFile
///
void QQPalmiLineEdit::joinFile(QString fileName)
void QQPalmiLineEdit::attachFile(QString fileName)
{
if(fileName.isEmpty())
fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
Expand All @@ -153,7 +153,7 @@ void QQPalmiLineEdit::dropEvent(QDropEvent *event)
QUrl url = event->mimeData()->urls().at(0);
if(url.isLocalFile())
{
joinFile(url.toLocalFile());
attachFile(url.toLocalFile());
event->accept();
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/palmipede/qqpalmilineedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public slots:
void strike();
void underline();

void joinFile(QString fileName = QString(""));
void attachFile(QString fileName = QString(""));

protected:
virtual void dropEvent(QDropEvent *event);
Expand Down
2 changes: 2 additions & 0 deletions ui/qqpalmipede.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ QQPalmipede::QQPalmipede(QWidget *parent) :
m_ui->postPushButton, SLOT(animateClick()));
connect(m_ui->postLineEdit, SIGNAL(changeBoard(bool)),
this, SLOT(changeBoard(bool)));
connect(m_ui->attachButton, SIGNAL(clicked()),
m_ui->postLineEdit, SLOT(attachFile()));

m_ui->boardSelectorComboBoxMin->setVisible(this->m_minimal);
}
Expand Down
25 changes: 16 additions & 9 deletions ui/qqpalmipede.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>650</width>
<height>103</height>
<width>592</width>
<height>109</height>
</rect>
</property>
<property name="sizePolicy">
Expand All @@ -16,12 +16,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>408</width>
<height>0</height>
</size>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
</property>
Expand Down Expand Up @@ -64,6 +58,17 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="attachButton">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../rc/quteqoin_img.qrc">
<normaloff>:/img/attach.png</normaloff>:/img/attach.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -261,6 +266,8 @@
<header>ui/palmipede/qqpalmilineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../rc/quteqoin_img.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit 000d645

Please sign in to comment.