mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
Embedding dialog: use two buttons (will have more) for the actions
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19981 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9b4bd90138
commit
044d958788
@ -55,14 +55,6 @@ GuiEmbeddedFilesDialog::GuiEmbeddedFilesDialog(GuiEmbeddedFiles * form)
|
||||
}
|
||||
filesLW->setCurrentRow(0);
|
||||
//
|
||||
actionCB->addItem("No action");
|
||||
actionCB->addItem("Add file");
|
||||
actionCB->addItem("Extract file");
|
||||
actionCB->addItem("Extract all");
|
||||
actionCB->addItem("Embed all");
|
||||
actionCB->addItem("Embed layout file");
|
||||
actionCB->addItem("View file");
|
||||
actionCB->addItem("Edit file");
|
||||
update();
|
||||
}
|
||||
|
||||
@ -115,33 +107,10 @@ void GuiEmbeddedFilesDialog::update()
|
||||
statusGB->setEnabled(enabled);
|
||||
filesLW->setEnabled(enabled);
|
||||
fullpathLE->setEnabled(enabled);
|
||||
actionCB->setEnabled(enabled);
|
||||
actionPB->setEnabled(enabled);
|
||||
}
|
||||
|
||||
|
||||
void GuiEmbeddedFilesDialog::on_actionPB_clicked()
|
||||
{
|
||||
// FIXME.
|
||||
|
||||
// ACTION
|
||||
QString action = actionCB->currentText();
|
||||
if (action == "Add file") {
|
||||
addFile();
|
||||
} else if (action == "Extract file") {
|
||||
extractFile();
|
||||
} else if (action == "Extract all") {
|
||||
extractAll();
|
||||
} else if (action == "Embed all") {
|
||||
} else if (action == "Embed layout file") {
|
||||
} else if (action == "View file") {
|
||||
} else if (action == "Edit file") {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GuiEmbeddedFilesDialog::addFile()
|
||||
void GuiEmbeddedFilesDialog::on_addPB_clicked()
|
||||
{
|
||||
docstring const file = form_->browseFile();
|
||||
if (!file.empty()) {
|
||||
@ -151,25 +120,13 @@ void GuiEmbeddedFilesDialog::addFile()
|
||||
}
|
||||
|
||||
|
||||
bool GuiEmbeddedFilesDialog::extractFile()
|
||||
void GuiEmbeddedFilesDialog::on_extractPB_clicked()
|
||||
{
|
||||
EmbeddedFiles const & files = form_->embeddedFiles();
|
||||
QList<QListWidgetItem *> selection = filesLW->selectedItems();
|
||||
form_->extract(files[filesLW->row(*selection.begin())]);
|
||||
}
|
||||
|
||||
|
||||
bool GuiEmbeddedFilesDialog::extractAll()
|
||||
{
|
||||
EmbeddedFiles const & files = form_->embeddedFiles();
|
||||
files.extractAll();
|
||||
}
|
||||
|
||||
|
||||
void GuiEmbeddedFilesDialog::on_actionCB_stateChanged(int idx)
|
||||
{
|
||||
// valid action, enable action button
|
||||
actionPB->setEnabled(idx != 0);
|
||||
for (QList<QListWidgetItem*>::iterator it = selection.begin();
|
||||
it != selection.end(); ++it)
|
||||
form_->extract(files[filesLW->row(*it)]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,19 +34,15 @@ public Q_SLOTS:
|
||||
///
|
||||
void update();
|
||||
///
|
||||
void on_actionPB_clicked();
|
||||
///
|
||||
void on_actionCB_stateChanged(int);
|
||||
///
|
||||
void on_enableCB_toggled(bool enable);
|
||||
///
|
||||
void on_autoRB_clicked();
|
||||
void on_embeddedRB_clicked();
|
||||
void on_externalRB_clicked();
|
||||
///
|
||||
void addFile();
|
||||
bool extractFile();
|
||||
bool extractAll();
|
||||
void on_addPB_clicked();
|
||||
//
|
||||
void on_extractPB_clicked();
|
||||
private:
|
||||
void set_embedding_status(EmbeddedFile::STATUS);
|
||||
///
|
||||
|
@ -109,22 +109,40 @@
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="actionCB" >
|
||||
<widget class="QToolButton" name="addPB" >
|
||||
<property name="toolTip" >
|
||||
<string>Actions to perform</string>
|
||||
<string>Add embedded file</string>
|
||||
</property>
|
||||
<property name="currentIndex" >
|
||||
<number>-1</number>
|
||||
<property name="text" >
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset>../../../../lib/images/file-open.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="actionPB" >
|
||||
<widget class="QToolButton" name="extractPB" >
|
||||
<property name="toolTip" >
|
||||
<string>Extract this file to disk</string>
|
||||
<string>Extract selected file.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Action!</string>
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset>../../../../lib/images/depth-increment.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user