8
8
#include " common/shortcuts.h"
9
9
#include " common/textdata.h"
10
10
#include " gui/icons.h"
11
+ #include " gui/fromiconid.h"
11
12
#include " platform/platformnativeinterface.h"
12
13
13
14
#include < QCoreApplication>
@@ -38,14 +39,14 @@ QVector<Command> predefinedCommands()
38
39
commands.prepend (Command ());
39
40
c = &commands.first ();
40
41
c->name = AddCommandDialog::tr (" New command" );
41
- c->icon = QString ( QChar ( IconFile) );
42
+ c->icon = fromIconId ( IconFile);
42
43
c->input = c->output = QString ();
43
44
c->wait = c->automatic = c->remove = false ;
44
45
c->sep = QLatin1String (" \\ n" );
45
46
46
47
c = newCommand (&commands);
47
48
c->name = AddCommandDialog::tr (" Ignore items with no or single character" );
48
- c->icon = QString ( QChar ( IconCircleExclamation) );
49
+ c->icon = fromIconId ( IconCircleExclamation);
49
50
c->cmd = R"( function hasEmptyOrSingleCharText() {
50
51
if (dataFormats().includes(mimeText)) {
51
52
const text = str(data(mimeText));
@@ -75,23 +76,23 @@ overrideFunction('provideSelection');
75
76
c = newCommand (&commands);
76
77
c->name = AddCommandDialog::tr (" Open in &Browser" );
77
78
c->re = reURL;
78
- c->icon = QString ( QChar ( IconGlobe) );
79
+ c->icon = fromIconId ( IconGlobe);
79
80
c->cmd = QStringLiteral (" copyq open %1" );
80
81
c->hideWindow = true ;
81
82
c->inMenu = true ;
82
83
83
84
c = newCommand (&commands);
84
85
c->name = AddCommandDialog::tr (" Paste as Plain Text" );
85
86
c->input = mimeText;
86
- c->icon = QString ( QChar ( IconPaste) );
87
+ c->icon = fromIconId ( IconPaste);
87
88
c->cmd = QStringLiteral (" copyq:" ) + pasteAsPlainTextScript (" input()" );
88
89
c->hideWindow = true ;
89
90
c->inMenu = true ;
90
91
91
92
c = newCommand (&commands);
92
93
c->name = AddCommandDialog::tr (" Autoplay videos" );
93
94
c->re = QRegularExpression (" ^http://.*\\ .(mp4|avi|mkv|wmv|flv|ogv)$" );
94
- c->icon = QString ( QChar ( IconCirclePlay) );
95
+ c->icon = fromIconId ( IconCirclePlay);
95
96
c->cmd = QStringLiteral (" copyq open %1" );
96
97
c->automatic = true ;
97
98
c->hideWindow = true ;
@@ -100,13 +101,13 @@ overrideFunction('provideSelection');
100
101
c = newCommand (&commands);
101
102
c->name = AddCommandDialog::tr (" Copy URL (web address) to other tab" );
102
103
c->re = reURL;
103
- c->icon = QString ( QChar ( IconCopy) );
104
+ c->icon = fromIconId ( IconCopy);
104
105
c->tab = QStringLiteral (" &web" );
105
106
c->automatic = true ;
106
107
107
108
c = newCommand (&commands);
108
109
c->name = AddCommandDialog::tr (" Create thumbnail (needs ImageMagick)" );
109
- c->icon = QString ( QChar ( IconImage) );
110
+ c->icon = fromIconId ( IconImage);
110
111
c->cmd = QStringLiteral (" convert - -resize 92x92 png:-" );
111
112
c->input = QStringLiteral (" image/png" );
112
113
c->output = QStringLiteral (" image/png" );
@@ -115,7 +116,7 @@ overrideFunction('provideSelection');
115
116
c = newCommand (&commands);
116
117
c->name = AddCommandDialog::tr (" Create QR Code from URL (needs qrencode)" );
117
118
c->re = reURL;
118
- c->icon = QString ( QChar ( IconQrcode) );
119
+ c->icon = fromIconId ( IconQrcode);
119
120
c->cmd = QStringLiteral (" qrencode -o - -t PNG -s 6" );
120
121
c->input = mimeText;
121
122
c->output = QStringLiteral (" image/png" );
@@ -126,23 +127,23 @@ overrideFunction('provideSelection');
126
127
c = newCommand (&commands);
127
128
c->name = AddCommandDialog::tr (" Add to %1 tab" , " %1 is quoted Tasks tab name" )
128
129
.arg (todoTabQuoted);
129
- c->icon = QString ( QChar ( IconShare) );
130
+ c->icon = fromIconId ( IconShare);
130
131
c->tab = todoTab;
131
132
c->input = mimeText;
132
133
c->inMenu = true ;
133
134
134
135
c = newCommand (&commands);
135
136
c->name = AddCommandDialog::tr (" Move to %1 tab" , " %1 is quoted Tasks tab name" )
136
137
.arg (todoTabQuoted);
137
- c->icon = QString ( QChar ( IconShare) );
138
+ c->icon = fromIconId ( IconShare);
138
139
c->tab = todoTab;
139
140
c->remove = true ;
140
141
c->inMenu = true ;
141
142
142
143
c = newCommand (&commands);
143
144
c->name = AddCommandDialog::tr (" Ignore copied files" );
144
145
c->re = reNotURL;
145
- c->icon = QString ( QChar ( IconCircleExclamation) );
146
+ c->icon = fromIconId ( IconCircleExclamation);
146
147
c->input = mimeUriList;
147
148
c->remove = true ;
148
149
c->automatic = true ;
@@ -151,22 +152,22 @@ overrideFunction('provideSelection');
151
152
c = newCommand (&commands);
152
153
c->name = AddCommandDialog::tr (" Ignore *\" Password\" * window" );
153
154
c->wndre = QRegularExpression (AddCommandDialog::tr (" Password" ));
154
- c->icon = QString ( QChar ( IconAsterisk) );
155
+ c->icon = fromIconId ( IconAsterisk);
155
156
c->remove = true ;
156
157
c->automatic = true ;
157
158
c->cmd = QStringLiteral (" copyq ignore" );
158
159
}
159
160
160
161
c = newCommand (&commands);
161
162
c->name = AddCommandDialog::tr (" Move to Trash" );
162
- c->icon = QString ( QChar ( IconTrash) );
163
+ c->icon = fromIconId ( IconTrash);
163
164
c->inMenu = true ;
164
165
c->tab = AddCommandDialog::tr (" (trash)" );
165
166
c->remove = true ;
166
167
167
168
c = newCommand (&commands);
168
169
c->name = AddCommandDialog::tr (" Clear Current Tab" );
169
- c->icon = QString ( QChar ( IconBroom) );
170
+ c->icon = fromIconId ( IconBroom);
170
171
c->inMenu = true ;
171
172
c->cmd = QStringLiteral (" copyq: ItemSelection(selectedTab()).selectRemovable().removeAll()" );
172
173
c->matchCmd = QStringLiteral (" copyq: tab(selectedTab()); if (size() == 0) fail()" );
0 commit comments