Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
6957a7f5
Commit
6957a7f5
authored
Nov 27, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Cleaned up WAttText slightly.
parent
f4724c02
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
wb/lib/wb/qt/wb_foe_qt.cqt
wb/lib/wb/qt/wb_foe_qt.cqt
+0
-1
wb/lib/wb/qt/wb_watttext_qt.cqt
wb/lib/wb/qt/wb_watttext_qt.cqt
+15
-19
wb/lib/wb/qt/wb_watttext_qt.h
wb/lib/wb/qt/wb_watttext_qt.h
+1
-2
wb/lib/wb/qt/wb_wcast_qt.cpp
wb/lib/wb/qt/wb_wcast_qt.cpp
+5
-0
wb/lib/wb/qt/wb_wcast_qt.h
wb/lib/wb/qt/wb_wcast_qt.h
+1
-0
No files found.
wb/lib/wb/qt/wb_foe_qt.cqt
View file @
6957a7f5
...
...
@@ -721,7 +721,6 @@ void WFoeQt::pop()
void WFoeQtWidget::closeEvent(QCloseEvent* event)
{
debug_print("WFoeQtWidget::closeEvent\n");
foe->activate_quit();
QWidget::closeEvent(event);
}
...
...
wb/lib/wb/qt/wb_watttext_qt.cqt
View file @
6957a7f5
...
...
@@ -36,6 +36,8 @@
/* wb_watttext_qt.cpp -- Display object attributes */
#include "co_string.h"
#include "cow_qt_helpers.h"
#include "cow_wow_qt.h"
#include "cow_xhelp.h"
...
...
@@ -77,19 +79,6 @@ void WAttTextQtWidget::action_text_inserted()
//
// Callbackfunctions from menu entries
//
void WAttTextQtWidget::activate_save()
{
atxt->set_attr_value();
atxt->modified = 0;
}
void WAttTextQtWidget::activate_saveandclose()
{
atxt->set_attr_value();
atxt->modified = 0;
atxt->activate_exit();
}
void WAttTextQtWidget::activate_copy()
{
QApplication::clipboard()->setText(atxt->textbuffer->toPlainText());
...
...
@@ -109,7 +98,7 @@ void WAttTextQtWidget::activate_paste()
void WAttTextQtWidget::activate_ok()
{
atxt->set_attr_value();
atxt->modified = 0;
close();
}
...
...
@@ -152,9 +141,10 @@ void WAttTextQt::set_editmode(int editmode, ldh_tSesContext ldhses)
void WAttTextQt::set_attr_value()
{
if (editmode) {
char* text = qPrintableLatin1(textbuffer->toPlainText());
char text[input_max_length];
strncpy(text, qPrintableLatin1(textbuffer->toPlainText()), input_max_length);
if (
text
) {
if (
!streq(text, "")
) {
// Replace ctrl characters with space
for (unsigned char* s = (unsigned char*)text; *s; s++) {
if (*s < ' ' && *s != 10 && *s != 13) {
...
...
@@ -172,7 +162,6 @@ void WAttTextQt::set_attr_value()
void WAttTextQtWidget::closeEvent(QCloseEvent* event)
{
debug_print("WAttTextQtWidget::closeEvent\n");
if (atxt->close_cb) {
(atxt->close_cb)(atxt);
} else {
...
...
@@ -182,6 +171,13 @@ void WAttTextQtWidget::closeEvent(QCloseEvent* event)
QWidget::closeEvent(event);
}
WAttTextQt::~WAttTextQt()
{
if (wow) {
delete wow;
}
}
WAttTextQt::WAttTextQt(QWidget* wa_parent_wid, void* wa_parent_ctx,
ldh_tSesContext wa_ldhses, pwr_sAttrRef wa_aref, int wa_editmode,
pwr_tStatus* status)
...
...
@@ -214,9 +210,9 @@ WAttTextQt::WAttTextQt(QWidget* wa_parent_wid, void* wa_parent_ctx,
// File entry
QMenu* file = menu_bar->addMenu(translate_utf8("&File"));
addMenuItem(toplevel, file, "&Save", SLOT(activate_
save
()), "CTRL+S",
addMenuItem(toplevel, file, "&Save", SLOT(activate_
apply
()), "CTRL+S",
"document-save");
addMenuItem(toplevel, file, "S&ave and close", SLOT(activate_
saveandclose
()),
addMenuItem(toplevel, file, "S&ave and close", SLOT(activate_
ok
()),
"CTRL+T");
addMenuItem(
toplevel, file, "&Close", SLOT(close()), "CTRL+W", "window-close");
...
...
wb/lib/wb/qt/wb_watttext_qt.h
View file @
6957a7f5
...
...
@@ -51,6 +51,7 @@ public:
WAttTextQt
(
QWidget
*
wa_parent_wid
,
void
*
wa_parent_ctx
,
ldh_tSesContext
wa_ldhses
,
pwr_sAttrRef
wa_aref
,
int
wa_editmode
,
pwr_tStatus
*
status
);
~
WAttTextQt
();
QLabel
*
msg_label
;
QTextEdit
*
textbuffer
;
int
input_max_length
;
...
...
@@ -79,8 +80,6 @@ protected:
void
closeEvent
(
QCloseEvent
*
event
);
public
slots
:
void
activate_save
();
void
activate_saveandclose
();
void
activate_copy
();
void
activate_cut
();
void
activate_paste
();
...
...
wb/lib/wb/qt/wb_wcast_qt.cpp
View file @
6957a7f5
...
...
@@ -49,4 +49,9 @@ WCastQt::WCastQt(void* wc_parent_ctx, QWidget* wc_parent_wid,
open_castlist
();
*
status
=
1
;
}
WCastQt
::~
WCastQt
()
{
delete
wow
;
}
\ No newline at end of file
wb/lib/wb/qt/wb_wcast_qt.h
View file @
6957a7f5
...
...
@@ -47,6 +47,7 @@ class WCastQt : public WCast {
public:
WCastQt
(
void
*
wc_parent_ctx
,
QWidget
*
wc_parent_wid
,
const
char
*
wc_name
,
ldh_tSesContext
wc_ldhses
,
pwr_sAttrRef
wc_aref
,
pwr_tStatus
*
status
);
~
WCastQt
();
};
#endif
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment