|
a/src/qtgui/restable.cpp |
|
b/src/qtgui/restable.cpp |
|
... |
|
... |
45 |
#include "rclconfig.h"
|
45 |
#include "rclconfig.h"
|
46 |
#include "plaintorich.h"
|
46 |
#include "plaintorich.h"
|
47 |
#include "indexer.h"
|
47 |
#include "indexer.h"
|
48 |
#include "respopup.h"
|
48 |
#include "respopup.h"
|
49 |
#include "rclmain_w.h"
|
49 |
#include "rclmain_w.h"
|
|
|
50 |
#include "multisave.h"
|
50 |
|
51 |
|
51 |
static const QKeySequence quitKeySeq("Ctrl+q");
|
52 |
static const QKeySequence quitKeySeq("Ctrl+q");
|
52 |
static const QKeySequence closeKeySeq("Ctrl+w");
|
53 |
static const QKeySequence closeKeySeq("Ctrl+w");
|
53 |
|
54 |
|
54 |
// Compensate for the default and somewhat bizarre vertical placement
|
55 |
// Compensate for the default and somewhat bizarre vertical placement
|
|
... |
|
... |
757 |
LOGDEB(("ResTable::createPopupMenu: m_detaildocnum %d\n", m_detaildocnum));
|
758 |
LOGDEB(("ResTable::createPopupMenu: m_detaildocnum %d\n", m_detaildocnum));
|
758 |
if (m_detaildocnum >= 0 && m_model) {
|
759 |
if (m_detaildocnum >= 0 && m_model) {
|
759 |
QMenu *popup =
|
760 |
QMenu *popup =
|
760 |
ResultPopup::create(this, m_ismainres? ResultPopup::isMain : 0,
|
761 |
ResultPopup::create(this, m_ismainres? ResultPopup::isMain : 0,
|
761 |
m_model->getDocSource(), m_detaildoc);
|
762 |
m_model->getDocSource(), m_detaildoc);
|
|
|
763 |
popup->addAction(this->tr("Save selection to files"),
|
|
|
764 |
this, SLOT(menuSaveSelection()));
|
762 |
popup->popup(mapToGlobal(pos));
|
765 |
popup->popup(mapToGlobal(pos));
|
763 |
}
|
766 |
}
|
764 |
}
|
767 |
}
|
765 |
|
768 |
|
766 |
void ResTable::menuPreview()
|
769 |
void ResTable::menuPreview()
|
|
... |
|
... |
776 |
|
779 |
|
777 |
void ResTable::menuSaveToFile()
|
780 |
void ResTable::menuSaveToFile()
|
778 |
{
|
781 |
{
|
779 |
if (m_detaildocnum >= 0)
|
782 |
if (m_detaildocnum >= 0)
|
780 |
emit docSaveToFileClicked(m_detaildoc);
|
783 |
emit docSaveToFileClicked(m_detaildoc);
|
|
|
784 |
}
|
|
|
785 |
|
|
|
786 |
void ResTable::menuSaveSelection()
|
|
|
787 |
{
|
|
|
788 |
if (m_model == 0 || m_model->getDocSource().isNull())
|
|
|
789 |
return;
|
|
|
790 |
|
|
|
791 |
QModelIndexList indexl = tableView->selectionModel()->selectedRows();
|
|
|
792 |
vector<Rcl::Doc> v;
|
|
|
793 |
for (int i = 0; i < indexl.size(); i++) {
|
|
|
794 |
Rcl::Doc doc;
|
|
|
795 |
if (m_model->getDocSource()->getDoc(indexl[i].row(), doc))
|
|
|
796 |
v.push_back(doc);
|
|
|
797 |
}
|
|
|
798 |
if (v.size() == 0) {
|
|
|
799 |
return;
|
|
|
800 |
} else if (v.size() == 1) {
|
|
|
801 |
emit docSaveToFileClicked(v[0]);
|
|
|
802 |
} else {
|
|
|
803 |
multiSave(this, v);
|
|
|
804 |
}
|
781 |
}
|
805 |
}
|
782 |
|
806 |
|
783 |
void ResTable::menuPreviewParent()
|
807 |
void ResTable::menuPreviewParent()
|
784 |
{
|
808 |
{
|
785 |
if (m_detaildocnum >= 0 && m_model &&
|
809 |
if (m_detaildocnum >= 0 && m_model &&
|