1
/***************************************************************************
2
* Copyright (c) 2009 Jürgen Riegel <juergen.riegel@web.de> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
24
#include "PreCompiled.h"
26
/// Here the FreeCAD includes sorted by Base,App,Gui......
28
#include <boost/bind/bind.hpp>
31
#include <QApplication>
32
#include <QButtonGroup>
42
#include <QButtonGroup>
45
#include <QRadioButton>
48
#include <Gui/ActionFunction.h>
49
#include <Gui/Application.h>
50
#include <Gui/Command.h>
51
#include <Gui/TaskView/TaskView.h>
52
#include <Gui/BitmapFactory.h>
54
#include "TaskPanelView.h"
57
using namespace SandboxGui;
58
namespace bp = boost::placeholders;
61
#if defined(QSINT_ACTIONPANEL)
69
QGridLayout *gridLayout;
70
QSint::ActionPanel *ActionPanel;
71
QSint::ActionGroup *ActionGroup1;
72
QVBoxLayout *verticalLayout;
73
QRadioButton *rbDefaultScheme;
74
QRadioButton *rbXPBlueScheme;
75
QRadioButton *rbXPBlue2Scheme;
76
QRadioButton *rbVistaScheme;
77
QRadioButton *rbMacScheme;
78
QRadioButton *rbAndroidScheme;
79
QSpacerItem *verticalSpacer;
81
void setupUi(QWidget *MainWindow2)
83
if (MainWindow2->objectName().isEmpty())
84
MainWindow2->setObjectName(QString::fromUtf8("MainWindow2"));
85
MainWindow2->resize(529, 407);
86
MainWindow2->setStyleSheet(QString::fromUtf8("\n"
88
" background-color: green;\n"
91
actionNew = new QAction(MainWindow2);
92
actionNew->setObjectName(QString::fromUtf8("actionNew"));
94
icon.addFile(QString::fromUtf8(":/icons/document-new.svg"), QSize(), QIcon::Normal, QIcon::Off);
95
actionNew->setIcon(icon);
96
actionLoad = new QAction(MainWindow2);
97
actionLoad->setObjectName(QString::fromUtf8("actionLoad"));
99
icon1.addFile(QString::fromUtf8(":/icons/document-open.svg"), QSize(), QIcon::Normal, QIcon::Off);
100
actionLoad->setIcon(icon1);
101
actionSave = new QAction(MainWindow2);
102
actionSave->setObjectName(QString::fromUtf8("actionSave"));
103
actionSave->setEnabled(false);
105
icon2.addFile(QString::fromUtf8(":/icons/document-save.svg"), QSize(), QIcon::Normal, QIcon::Off);
106
actionSave->setIcon(icon2);
107
actionPrint = new QAction(MainWindow2);
108
actionPrint->setObjectName(QString::fromUtf8("actionPrint"));
110
icon3.addFile(QString::fromUtf8(":/icons/document-print.svg"), QSize(), QIcon::Normal, QIcon::Off);
111
actionPrint->setIcon(icon3);
112
gridLayout = new QGridLayout(MainWindow2);
113
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
114
ActionPanel = new QSint::ActionPanel(MainWindow2);
115
ActionPanel->setObjectName(QString::fromUtf8("ActionPanel"));
116
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
117
sizePolicy.setHorizontalStretch(0);
118
sizePolicy.setVerticalStretch(0);
119
sizePolicy.setHeightForWidth(ActionPanel->sizePolicy().hasHeightForWidth());
120
ActionPanel->setSizePolicy(sizePolicy);
122
gridLayout->addWidget(ActionPanel, 0, 0, 2, 1);
124
ActionGroup1 = new QSint::ActionGroup(MainWindow2);
125
ActionGroup1->setObjectName(QString::fromUtf8("ActionGroup1"));
126
ActionGroup1->setProperty("expandable", QVariant(true));
127
ActionGroup1->setProperty("header", QVariant(true));
128
verticalLayout = new QVBoxLayout(ActionGroup1);
129
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
130
rbDefaultScheme = new QRadioButton(ActionGroup1);
131
rbDefaultScheme->setObjectName(QString::fromUtf8("rbDefaultScheme"));
132
rbDefaultScheme->setChecked(true);
134
verticalLayout->addWidget(rbDefaultScheme);
136
rbXPBlueScheme = new QRadioButton(ActionGroup1);
137
rbXPBlueScheme->setObjectName(QString::fromUtf8("rbXPBlueScheme"));
139
verticalLayout->addWidget(rbXPBlueScheme);
141
rbXPBlue2Scheme = new QRadioButton(ActionGroup1);
142
rbXPBlue2Scheme->setObjectName(QString::fromUtf8("rbXPBlue2Scheme"));
144
verticalLayout->addWidget(rbXPBlue2Scheme);
146
rbVistaScheme = new QRadioButton(ActionGroup1);
147
rbVistaScheme->setObjectName(QString::fromUtf8("rbVistaScheme"));
149
verticalLayout->addWidget(rbVistaScheme);
151
rbMacScheme = new QRadioButton(ActionGroup1);
152
rbMacScheme->setObjectName(QString::fromUtf8("rbMacScheme"));
154
verticalLayout->addWidget(rbMacScheme);
156
rbAndroidScheme = new QRadioButton(ActionGroup1);
157
rbAndroidScheme->setObjectName(QString::fromUtf8("rbAndroidScheme"));
159
verticalLayout->addWidget(rbAndroidScheme);
162
gridLayout->addWidget(ActionGroup1, 0, 1, 1, 1);
164
verticalSpacer = new QSpacerItem(20, 57, QSizePolicy::Minimum, QSizePolicy::Expanding);
166
gridLayout->addItem(verticalSpacer, 1, 1, 1, 1);
169
retranslateUi(MainWindow2);
171
QMetaObject::connectSlotsByName(MainWindow2);
174
void retranslateUi(QWidget *MainWindow2)
176
MainWindow2->setWindowTitle(QApplication::translate("MainWindow2", "ActionBox Example"));
177
actionNew->setText(QApplication::translate("MainWindow2", "Create new file"));
178
actionLoad->setText(QApplication::translate("MainWindow2", "Load a file"));
179
actionSave->setText(QApplication::translate("MainWindow2", "Save current file"));
180
actionPrint->setText(QApplication::translate("MainWindow2", "Print file contents"));
181
ActionGroup1->setProperty("headerText", QVariant(QApplication::translate("MainWindow2", "Choose Scheme")));
182
rbDefaultScheme->setText(QApplication::translate("MainWindow2", "Default"));
183
rbXPBlueScheme->setText(QApplication::translate("MainWindow2", "XP Blue"));
184
rbXPBlue2Scheme->setText(QApplication::translate("MainWindow2", "XP Blue 2"));
185
rbVistaScheme->setText(QApplication::translate("MainWindow2", "Vista"));
186
rbMacScheme->setText(QApplication::translate("MainWindow2", "MacOS"));
187
rbAndroidScheme->setText(QApplication::translate("MainWindow2", "Android"));
188
Q_UNUSED(MainWindow2);
193
class Ui_TaskActionBox
196
QVBoxLayout *verticalLayout;
197
QVBoxLayout *verticalLayout_3;
200
QGridLayout *gridLayout_2;
201
QSint::ActionBox *ActionBox1;
202
QSint::ActionBox *ActionBox2;
203
QSpacerItem *verticalSpacer;
204
QSint::ActionBox *ActionBox3;
205
QSint::ActionBox *ActionBox4;
206
Gui::TaskView::TaskGroup *ActionBox5;
207
QVBoxLayout *verticalLayout_4;
210
QVBoxLayout *verticalLayout_2;
211
QSint::ActionLabel *ActionLabel1;
212
QSint::ActionLabel *ActionLabel2;
213
QSint::ActionLabel *ActionLabel3;
215
void setupUi(QWidget *MainWindow)
217
MainWindow->resize(642, 850);
218
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
219
sizePolicy.setHorizontalStretch(0);
220
sizePolicy.setVerticalStretch(0);
221
sizePolicy.setHeightForWidth(MainWindow->sizePolicy().hasHeightForWidth());
222
MainWindow->setSizePolicy(sizePolicy);
223
MainWindow->setStyleSheet(QString::fromUtf8("\n"
224
"SandboxGui--TaskPanelView {\n"
225
" background-color: green;\n"
228
verticalLayout = new QVBoxLayout(MainWindow);
229
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
230
verticalLayout_3 = new QVBoxLayout();
231
verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
232
label = new QLabel(MainWindow);
233
label->setObjectName(QString::fromUtf8("label"));
234
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Maximum);
235
sizePolicy1.setHorizontalStretch(0);
236
sizePolicy1.setVerticalStretch(0);
237
sizePolicy1.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
238
label->setSizePolicy(sizePolicy1);
240
verticalLayout_3->addWidget(label);
242
line_2 = new QFrame(MainWindow);
243
line_2->setObjectName(QString::fromUtf8("line_2"));
244
line_2->setFrameShape(QFrame::HLine);
245
line_2->setFrameShadow(QFrame::Sunken);
247
verticalLayout_3->addWidget(line_2);
250
verticalLayout->addLayout(verticalLayout_3);
252
gridLayout_2 = new QGridLayout();
253
gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
254
ActionBox1 = new QSint::ActionBox(MainWindow);
255
ActionBox1->setObjectName(QString::fromUtf8("ActionBox1"));
256
ActionBox1->setFrameShape(QFrame::StyledPanel);
257
ActionBox1->setFrameShadow(QFrame::Raised);
259
gridLayout_2->addWidget(ActionBox1, 0, 0, 1, 1);
261
ActionBox2 = new QSint::ActionBox(MainWindow);
262
ActionBox2->setObjectName(QString::fromUtf8("ActionBox2"));
263
ActionBox2->setFrameShape(QFrame::StyledPanel);
264
ActionBox2->setFrameShadow(QFrame::Raised);
266
gridLayout_2->addWidget(ActionBox2, 1, 0, 1, 1);
268
verticalSpacer = new QSpacerItem(94, 28, QSizePolicy::Minimum, QSizePolicy::Minimum);
270
gridLayout_2->addItem(verticalSpacer, 3, 0, 1, 1);
272
ActionBox3 = new QSint::ActionBox(MainWindow);
273
ActionBox3->setObjectName(QString::fromUtf8("ActionBox3"));
274
ActionBox3->setFrameShape(QFrame::StyledPanel);
275
ActionBox3->setFrameShadow(QFrame::Raised);
277
gridLayout_2->addWidget(ActionBox3, 0, 1, 1, 1);
279
ActionBox4 = new QSint::ActionBox(MainWindow);
280
ActionBox4->setObjectName(QString::fromUtf8("ActionBox4"));
281
ActionBox4->setFrameShape(QFrame::StyledPanel);
282
ActionBox4->setFrameShadow(QFrame::Raised);
284
gridLayout_2->addWidget(ActionBox4, 1, 1, 1, 1);
286
ActionBox5 = new Gui::TaskView::TaskGroup(MainWindow);
287
ActionBox5->setObjectName(QString::fromUtf8("ActionBox5"));
288
ActionBox5->setFrameShape(QFrame::StyledPanel);
289
ActionBox5->setFrameShadow(QFrame::Raised);
291
gridLayout_2->addWidget(ActionBox5, 2, 1, 1, 1);
293
verticalLayout->addLayout(gridLayout_2);
295
verticalLayout_4 = new QVBoxLayout();
296
verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4"));
297
label_2 = new QLabel(MainWindow);
298
label_2->setObjectName(QString::fromUtf8("label_2"));
299
sizePolicy1.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth());
300
label_2->setSizePolicy(sizePolicy1);
302
verticalLayout_4->addWidget(label_2);
304
line = new QFrame(MainWindow);
305
line->setObjectName(QString::fromUtf8("line"));
306
line->setFrameShape(QFrame::HLine);
307
line->setFrameShadow(QFrame::Sunken);
309
verticalLayout_4->addWidget(line);
312
verticalLayout->addLayout(verticalLayout_4);
314
verticalLayout_2 = new QVBoxLayout();
315
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
316
ActionLabel1 = new QSint::ActionLabel(MainWindow);
317
ActionLabel1->setObjectName(QString::fromUtf8("ActionLabel1"));
318
QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Fixed);
319
sizePolicy2.setHorizontalStretch(0);
320
sizePolicy2.setVerticalStretch(0);
321
sizePolicy2.setHeightForWidth(ActionLabel1->sizePolicy().hasHeightForWidth());
322
ActionLabel1->setSizePolicy(sizePolicy2);
324
verticalLayout_2->addWidget(ActionLabel1);
326
ActionLabel2 = new QSint::ActionLabel(MainWindow);
327
ActionLabel2->setObjectName(QString::fromUtf8("ActionLabel2"));
328
sizePolicy2.setHeightForWidth(ActionLabel2->sizePolicy().hasHeightForWidth());
329
ActionLabel2->setSizePolicy(sizePolicy2);
331
icon.addFile(QString::fromUtf8(":/icons/document-open.svg"), QSize(), QIcon::Normal, QIcon::Off);
332
ActionLabel2->setIcon(icon);
334
verticalLayout_2->addWidget(ActionLabel2);
336
ActionLabel3 = new QSint::ActionLabel(MainWindow);
337
ActionLabel3->setObjectName(QString::fromUtf8("ActionLabel3"));
338
sizePolicy2.setHeightForWidth(ActionLabel3->sizePolicy().hasHeightForWidth());
339
ActionLabel3->setSizePolicy(sizePolicy2);
341
icon1.addFile(QString::fromUtf8(":/icons/document-print.svg"), QSize(), QIcon::Normal, QIcon::Off);
342
ActionLabel3->setIcon(icon1);
344
verticalLayout_2->addWidget(ActionLabel3);
347
verticalLayout->addLayout(verticalLayout_2);
350
retranslateUi(MainWindow);
353
void retranslateUi(QWidget *MainWindow)
355
MainWindow->setWindowTitle(QApplication::translate("TestTaskBox", "ActionBox Example"));
356
label->setText(QApplication::translate("TestTaskBox", "ActionBoxes"));
357
label_2->setText(QApplication::translate("TestTaskBox", "ActionLabels"));
358
ActionLabel1->setText(QApplication::translate("TestTaskBox", "Simple clickable action"));
359
ActionLabel2->setText(QApplication::translate("TestTaskBox", "Simple clickable action with icon"));
361
ActionLabel3->setToolTip(QApplication::translate("TestTaskBox", "Tooltip of the ActionLabel"));
362
#endif // QT_NO_TOOLTIP
363
ActionLabel3->setText(QApplication::translate("TestTaskBox", "Simple clickable action with icon and tooltip"));
364
Q_UNUSED(MainWindow);
369
TaskPanelView::TaskPanelView(QWidget *parent)
372
Gui::ActionFunction* func = new Gui::ActionFunction(this);
373
QAction* action = new QAction(this);
374
func->trigger(action, boost::bind(&TaskPanelView::executeAction, this));
376
#if defined(QSINT_ACTIONPANEL)
378
QGridLayout* customLayout = new QGridLayout(this);
379
QTabWidget* tabWidget = new QTabWidget(this);
380
customLayout->addWidget(tabWidget, 0, 0);
381
this->resize(642, 850);
384
Ui_TaskActionBox* ui(new Ui_TaskActionBox);
385
QWidget* page1 = new QWidget();
387
tabWidget->addTab(page1, QLatin1String("Action Box"));
390
ui->ActionBox1->setIcon(QPixmap(QString::fromLatin1(":/icons/document-open.svg")));
391
ui->ActionBox1->header()->setText(QString::fromLatin1("Header of the group"));
392
connect(ui->ActionBox1->header(), SIGNAL(clicked()), action, SIGNAL(triggered()));
394
QSint::ActionLabel *a1 = ui->ActionBox1->createItem(QString::fromLatin1("This action has no icon"));
395
connect(a1, SIGNAL(clicked()), action, SIGNAL(triggered()));
396
QSint::ActionLabel *a2 = ui->ActionBox1->createItem(QPixmap(QString::fromLatin1(":/icons/document-print.svg")),
397
QString::fromLatin1("This action has icon"));
398
connect(a2, SIGNAL(clicked()), action, SIGNAL(triggered()));
400
QLayout *hbl1 = ui->ActionBox1->createHBoxLayout();
401
QSint::ActionLabel *a3 = ui->ActionBox1->createItem(QString::fromLatin1("1st action in row"), hbl1);
402
connect(a3, SIGNAL(clicked()), action, SIGNAL(triggered()));
403
QSint::ActionLabel *a4 = ui->ActionBox1->createItem(QString::fromLatin1("2nd action in row"), hbl1);
404
connect(a4, SIGNAL(clicked()), action, SIGNAL(triggered()));
407
ui->ActionBox2->setIcon(QPixmap(QString::fromLatin1(":/icons/document-save.png")));
408
ui->ActionBox2->header()->setText(QString::fromLatin1("Checkable actions allowed"));
409
connect(ui->ActionBox2->header(), SIGNAL(clicked()), action, SIGNAL(triggered()));
411
QSint::ActionLabel *b1 = ui->ActionBox2->createItem(QString::fromLatin1("Action 1 (Exclusive)"));
412
b1->setCheckable(true);
413
b1->setAutoExclusive(true);
414
b1->setChecked(true);
415
QSint::ActionLabel *b2 = ui->ActionBox2->createItem(QString::fromLatin1("Action 2 (Exclusive)"));
416
b2->setCheckable(true);
417
b2->setAutoExclusive(true);
418
QSint::ActionLabel *b3 = ui->ActionBox2->createItem(QString::fromLatin1("Action 3 (Exclusive)"));
419
b3->setCheckable(true);
420
b3->setAutoExclusive(true);
422
QSint::ActionLabel *b4 = ui->ActionBox2->createItem(QString::fromLatin1("Non-exclusive but still checkable"));
423
b4->setCheckable(true);
426
ui->ActionBox3->setIcon(QPixmap(QString::fromLatin1(":/icons/document-print.png")));
427
ui->ActionBox3->header()->setText(QString::fromLatin1("Also, widgets allowed as well"));
429
ui->ActionBox3->addWidget(new QPushButton(QString::fromLatin1("PushButton"), this));
430
ui->ActionBox3->addWidget(new QCheckBox(QString::fromLatin1("CheckBox"), this));
431
QLayout *hbl3 = ui->ActionBox3->createHBoxLayout();
432
ui->ActionBox3->addWidget(new QRadioButton(QString::fromLatin1("RadioButton 1"), this), hbl3);
433
ui->ActionBox3->addWidget(new QRadioButton(QString::fromLatin1("RadioButton 2"), this), hbl3);
436
ui->ActionBox4->setIcon(QPixmap(QString::fromLatin1(":/icons/document-open.png")));
437
ui->ActionBox4->header()->setText(QString::fromLatin1("ActionBox with different scheme"));
439
ui->ActionBox4->createItem(QString::fromLatin1("This action has no icon"));
440
ui->ActionBox4->createItem(QPixmap(QString::fromLatin1(":/icons/document-print.png")),
441
QString::fromLatin1("This action has icon"));
442
QLayout *hbl4 = ui->ActionBox4->createHBoxLayout();
443
ui->ActionBox4->createItem(QString::fromLatin1("1st action in row"), hbl4);
444
ui->ActionBox4->createItem(QString::fromLatin1("2nd action in row"), hbl4);
445
ui->ActionBox4->createItem(QString::fromLatin1("3rd action in row"), hbl4);
447
const char* ActionBoxNewStyle =
449
"background-color: #333333;"
450
"border: 1px solid #000000;"
454
"QSint--ActionBox:hover {"
455
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #666666, stop: 1 #333333);"
456
"border: 1px solid #222222;"
459
"QSint--ActionBox QSint--ActionLabel[class='header'] {"
460
"text-align: center;"
463
"background-color: transparent;"
464
"border: 1px solid transparent;"
467
"QSint--ActionBox QSint--ActionLabel[class='header']:hover {"
469
"text-decoration: underline;"
470
"border: 1px dotted #aaaaaa;"
473
"QSint--ActionBox QSint--ActionLabel[class='action'] {"
474
"background-color: transparent;"
481
"QSint--ActionBox QSint--ActionLabel[class='action']:hover {"
483
"text-decoration: underline;"
486
"QSint--ActionBox QSint--ActionLabel[class='action']:on {"
487
"background-color: #ddeeff;"
492
ui->ActionBox4->setStyleSheet(QString::fromLatin1(ActionBoxNewStyle));
495
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
496
ui->ActionBox5->setIcon(QPixmap(QString::fromLatin1(":/icons/document-save.png")));
497
ui->ActionBox5->header()->setText(QString::fromLatin1("TaskGroup with different scheme"));
499
rcCmdMgr.addTo("Std_New", ui->ActionBox5);
500
rcCmdMgr.addTo("Std_Open", ui->ActionBox5);
501
rcCmdMgr.addTo("Std_Save", ui->ActionBox5);
502
ui->ActionBox5->setStyleSheet(QString::fromLatin1(ActionBoxNewStyle));
505
Ui_TaskGroup* ui(new Ui_TaskGroup);
506
QWidget* page2 = new QWidget();
508
tabWidget->addTab(page2, QLatin1String("Action Group"));
510
this->actionGroup = ui->ActionPanel;
512
// create ActionGroups on ActionPanel
513
QIcon save = QIcon::fromTheme(QString::fromLatin1("document-save"));
514
QSint::ActionGroup *group1 = ui->ActionPanel->createGroup(save.pixmap(24,24), QString::fromLatin1("Expandable Group"));
515
group1->addAction(ui->actionNew);
516
group1->addAction(ui->actionLoad);
517
group1->addWidget(new QPushButton(QString::fromLatin1("Just a button"), this));
518
group1->addAction(ui->actionSave);
519
group1->addAction(ui->actionPrint);
520
group1->addWidget(new QPushButton(QString::fromLatin1("Just another button"), this));
522
QIcon redo = QIcon::fromTheme(QString::fromLatin1("edit-redo"));
523
QSint::ActionGroup *group2 = ui->ActionPanel->createGroup(redo.pixmap(24,24), QString::fromLatin1("Non-Expandable Group"), false);
524
group2->addAction(ui->actionNew);
525
group2->addAction(ui->actionLoad);
526
group2->addAction(ui->actionSave);
527
group2->addAction(ui->actionPrint);
529
ui->ActionPanel->addWidget(new QLabel(QString::fromLatin1("Action Group without header"), this));
531
QSint::ActionGroup *group3 = ui->ActionPanel->createGroup();
532
group3->addAction(ui->actionNew);
534
QHBoxLayout *hbl = new QHBoxLayout();
535
group3->groupLayout()->addLayout(hbl);
536
hbl->addWidget(group3->addAction(ui->actionLoad, false));
537
hbl->addWidget(group3->addAction(ui->actionSave, false));
539
group3->addAction(ui->actionPrint);
541
ui->ActionPanel->addStretch();
544
// setup standalone ActionGroup
546
ui->ActionGroup1->setScheme(QSint::WinXPPanelScheme::defaultScheme());
548
ui->ActionGroup1->addWidget(ui->rbDefaultScheme);
549
ui->ActionGroup1->addWidget(ui->rbXPBlueScheme);
550
ui->ActionGroup1->addWidget(ui->rbXPBlue2Scheme);
551
ui->ActionGroup1->addWidget(ui->rbVistaScheme);
552
ui->ActionGroup1->addWidget(ui->rbMacScheme);
553
ui->ActionGroup1->addWidget(ui->rbAndroidScheme);
555
Gui::ActionFunction* func = new Gui::ActionFunction(this);
557
QAction* defaultAction = new QAction(this);
558
connect(ui->rbDefaultScheme, SIGNAL(toggled(bool)), defaultAction, SIGNAL(toggled(bool)));
559
func->toggle(defaultAction, boost::bind(&TaskPanelView::on_rbDefaultScheme_toggled, this, bp::_1));
561
QAction* xpBlueAction = new QAction(this);
562
connect(ui->rbXPBlueScheme, SIGNAL(toggled(bool)), xpBlueAction, SIGNAL(toggled(bool)));
563
func->toggle(xpBlueAction, boost::bind(&TaskPanelView::on_rbXPBlueScheme_toggled, this, bp::_1));
565
QAction* xpBlue2Action = new QAction(this);
566
connect(ui->rbXPBlue2Scheme, SIGNAL(toggled(bool)), xpBlue2Action, SIGNAL(toggled(bool)));
567
func->toggle(xpBlue2Action, boost::bind(&TaskPanelView::on_rbXPBlue2Scheme_toggled, this, bp::_1));
569
QAction* vistaAction = new QAction(this);
570
connect(ui->rbVistaScheme, SIGNAL(toggled(bool)), vistaAction, SIGNAL(toggled(bool)));
571
func->toggle(vistaAction, boost::bind(&TaskPanelView::on_rbVistaScheme_toggled, this, bp::_1));
573
QAction* macAction = new QAction(this);
574
connect(ui->rbMacScheme, SIGNAL(toggled(bool)), macAction, SIGNAL(toggled(bool)));
575
func->toggle(macAction, boost::bind(&TaskPanelView::on_rbMacScheme_toggled, this, bp::_1));
577
QAction* androidAction = new QAction(this);
578
connect(ui->rbAndroidScheme, SIGNAL(toggled(bool)), androidAction, SIGNAL(toggled(bool)));
579
func->toggle(androidAction, boost::bind(&TaskPanelView::on_rbAndroidScheme_toggled, this, bp::_1));
584
TaskPanelView::~TaskPanelView()
588
void TaskPanelView::executeAction()
590
QMessageBox::about(0, QString::fromLatin1("Action clicked"), QString::fromLatin1("Do something here :)"));
593
void TaskPanelView::on_rbDefaultScheme_toggled(bool b)
595
#if defined(QSINT_ACTIONPANEL)
597
static_cast<QSint::ActionPanel *>(actionGroup)->setScheme(QSint::ActionPanelScheme::defaultScheme());
601
void TaskPanelView::on_rbXPBlueScheme_toggled(bool b)
603
#if defined(QSINT_ACTIONPANEL)
605
static_cast<QSint::ActionPanel *>(actionGroup)->setScheme(QSint::WinXPPanelScheme::defaultScheme());
609
void TaskPanelView::on_rbXPBlue2Scheme_toggled(bool b)
611
#if defined(QSINT_ACTIONPANEL)
613
static_cast<QSint::ActionPanel *>(actionGroup)->setScheme(QSint::WinXPPanelScheme2::defaultScheme());
617
void TaskPanelView::on_rbVistaScheme_toggled(bool b)
619
#if defined(QSINT_ACTIONPANEL)
621
static_cast<QSint::ActionPanel *>(actionGroup)->setScheme(QSint::WinVistaPanelScheme::defaultScheme());
625
void TaskPanelView::on_rbMacScheme_toggled(bool b)
627
#if defined(QSINT_ACTIONPANEL)
629
static_cast<QSint::ActionPanel *>(actionGroup)->setScheme(QSint::MacPanelScheme::defaultScheme());
633
void TaskPanelView::on_rbAndroidScheme_toggled(bool b)
635
#if defined(QSINT_ACTIONPANEL)
637
static_cast<QSint::ActionPanel *>(actionGroup)->setScheme(QSint::AndroidPanelScheme::defaultScheme());
641
//#include "moc_TaskPanelView.cpp"