Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
4e95d09c
Commit
4e95d09c
authored
Sep 27, 2011
by
ivan.ilyin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SANKORE-137 implement tooltip, testing on Win7
parent
f6684fc7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
UBLibraryWidget.cpp
src/gui/UBLibraryWidget.cpp
+55
-0
UBLibraryWidget.h
src/gui/UBLibraryWidget.h
+8
-0
No files found.
src/gui/UBLibraryWidget.cpp
View file @
4e95d09c
...
...
@@ -533,6 +533,8 @@ UBNewFolderDlg::UBNewFolderDlg(QWidget *parent, const char *name):QDialog(parent
connect
(
mpButtons
->
button
(
QDialogButtonBox
::
Ok
),
SIGNAL
(
clicked
()),
this
,
SLOT
(
accept
()));
connect
(
mpButtons
->
button
(
QDialogButtonBox
::
Cancel
),
SIGNAL
(
clicked
()),
this
,
SLOT
(
reject
()));
connect
(
mpLineEdit
,
SIGNAL
(
textChanged
(
const
QString
&
)),
this
,
SLOT
(
text_Changed
(
const
QString
&
)));
connect
(
mpLineEdit
,
SIGNAL
(
textEdited
(
const
QString
&
)),
this
,
SLOT
(
text_Edited
(
const
QString
&
)));
setMaximumHeight
(
100
);
setMinimumHeight
(
100
);
...
...
@@ -578,3 +580,56 @@ QString UBNewFolderDlg::folderName()
{
return
mpLineEdit
->
text
();
}
void
UBNewFolderDlg
::
text_Changed
(
const
QString
&
newText
)
{
}
/*
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash) // Note: The C++ compiler transforms backslashes in strings. To include a \ in a regexp, enter it twice, i.e. \\. To match the backslash character itself, enter it four times, i.e. \\\\.
| (vertical bar or pipe)
? (question mark)
* (asterisk)
*/
void
UBNewFolderDlg
::
text_Edited
(
const
QString
&
newText
)
{
QString
new_text
=
newText
;
#ifdef Q_WS_WIN // Defined on Windows.
QString
illegalCharList
(
" < > :
\"
/
\\
| ? * "
);
QRegExp
regExp
(
"[<>:
\"
/
\\\\
|?*]"
);
#endif
#ifdef Q_WS_QWS // Defined on Qt for Embedded Linux.
QString
illegalCharList
(
" < > :
\"
/
\\
| ? * "
);
QRegExp
regExp
(
"[<>:
\"
/
\\\\
|?*]"
);
#endif
#ifdef Q_WS_MAC // Defined on Mac OS X.
QString
illegalCharList
(
" < > :
\"
/
\\
| ? * "
);
QRegExp
regExp
(
"[<>:
\"
/
\\\\
|?*]"
);
#endif
#ifdef Q_WS_X11 // Defined on X11.
QString
illegalCharList
(
" < > :
\"
/
\\
| ? * "
);
QRegExp
regExp
(
"[<>:
\"
/
\\\\
|?*]"
);
#endif
if
(
new_text
.
indexOf
(
regExp
)
>
-
1
)
{
new_text
.
remove
(
regExp
);
mpLineEdit
->
setText
(
new_text
);
QToolTip
::
showText
(
mpLineEdit
->
mapToGlobal
(
QPoint
()),
"A file name can`t contain any of the following characters:
\r\n
"
+
illegalCharList
);
}
}
src/gui/UBLibraryWidget.h
View file @
4e95d09c
...
...
@@ -72,6 +72,7 @@ private slots:
void
onSelectionChanged
();
private
:
void
refreshView
();
void
generateItems
();
void
appendChainedElement
(
UBChainedLibElement
*
element
,
UBChainedLibElement
*
toElem
);
...
...
@@ -89,12 +90,19 @@ private:
class
UBNewFolderDlg
:
public
QDialog
{
Q_OBJECT
public
:
UBNewFolderDlg
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"NewFolderDlg"
);
~
UBNewFolderDlg
();
QString
folderName
();
public
slots
:
void
text_Changed
(
const
QString
&
);
void
text_Edited
(
const
QString
&
);
private
:
QLabel
*
mpLabel
;
QLineEdit
*
mpLineEdit
;
...
...
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