27 #include <QApplication>
29 #include <QVBoxLayout>
42 setObjectName (
"HistoryDockWidget");
43 setStatusTip (tr (
"Browse and search the command history."));
46 p, SLOT (new_file (
const QString&)));
48 connect (
this, SIGNAL (
information (
const QString&)),
49 p, SLOT (report_status_message (
const QString&)));
52 p, SLOT (execute_command_in_terminal (
const QString&)));
67 tr (
"Double-click a command to transfer it to the terminal."));
71 SIGNAL (customContextMenuRequested (
const QPoint &)),
this,
72 SLOT (
ctxMenu (
const QPoint &)));
76 tr (
"Enter text to filter the command history."));
77 QVBoxLayout *vbox_layout =
new QVBoxLayout ();
79 setWindowIcon (QIcon (
":/actions/icons/logo.png"));
85 vbox_layout->setMargin (2);
87 widget ()->setLayout (vbox_layout);
102 menu.addAction (tr (
"Evaluate"),
this,
104 menu.addAction (tr (
"Create script"),
this,
113 QModelIndexList rows = selectionModel->selectedRows ();
114 QModelIndexList::iterator it;
115 bool prev_valid_row =
false;
116 for (it = rows.begin (); it != rows.end (); it++)
118 if ((*it).isValid ())
122 text += (*it).data ().toString ();
123 prev_valid_row =
true;
126 QApplication::clipboard ()->setText (text);
132 QModelIndexList rows = selectionModel->selectedRows ();
133 QModelIndexList::iterator it;
134 for (it = rows.begin () ; it != rows.end (); it++)
136 if ((*it).isValid ())
146 QModelIndexList rows = selectionModel->selectedRows ();
148 bool prev_valid_row =
false;
149 for (QModelIndexList::iterator it = rows.begin (); it != rows.end (); it++)
151 if ((*it).isValid ())
155 text += (*it).data ().toString ();
156 prev_valid_row =
true;
160 if (text.length () > 0)
182 lst.append (hist_entry);
186 bool at_bottom = scroll_bar->maximum () - scroll_bar->value () < 1;
208 QClipboard *clipboard = QApplication::clipboard ();
218 QClipboard *clipboard = QApplication::clipboard ();
219 QString str = clipboard->text ();
220 if (str.length () > 0)