mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-24 18:35:37 +00:00
Fix the embedded files dialog's save button, so that it enables/disables as per selection.
BUG:229064 svn path=/trunk/KDE/kdegraphics/okular/; revision=1098392
This commit is contained in:
parent
3464f68c55
commit
a212da143a
|
@ -41,6 +41,7 @@ EmbeddedFilesDialog::EmbeddedFilesDialog(QWidget *parent, const Okular::Document
|
|||
setButtons(Close | User1);
|
||||
setDefaultButton(Close);
|
||||
setButtonGuiItem(User1, KStandardGuiItem::save());
|
||||
enableButton(User1, false);
|
||||
|
||||
m_tw = new QTreeWidget(this);
|
||||
setMainWidget(m_tw);
|
||||
|
@ -81,6 +82,13 @@ EmbeddedFilesDialog::EmbeddedFilesDialog(QWidget *parent, const Okular::Document
|
|||
|
||||
connect(this, SIGNAL(user1Clicked()), this, SLOT(saveFile()));
|
||||
connect(m_tw, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(attachViewContextMenu(QPoint)));
|
||||
connect(m_tw, SIGNAL(itemSelectionChanged()), this, SLOT(updateSaveButton()));
|
||||
}
|
||||
|
||||
void EmbeddedFilesDialog::updateSaveButton()
|
||||
{
|
||||
bool enable = (m_tw->selectedItems().count() > 0);
|
||||
enableButton(User1, enable);
|
||||
}
|
||||
|
||||
void EmbeddedFilesDialog::saveFile()
|
||||
|
|
|
@ -24,11 +24,12 @@ class EmbeddedFilesDialog : public KDialog
|
|||
Q_OBJECT
|
||||
public:
|
||||
EmbeddedFilesDialog(QWidget *parent, const Okular::Document *document);
|
||||
|
||||
|
||||
private slots:
|
||||
void saveFile();
|
||||
void attachViewContextMenu( const QPoint& pos );
|
||||
|
||||
void updateSaveButton();
|
||||
|
||||
private:
|
||||
void saveFile( Okular::EmbeddedFile* );
|
||||
|
||||
|
|
Loading…
Reference in a new issue