| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2009 by The qGo Project * |
| 3 | * * |
| 4 | * This file is part of qGo. * |
| 5 | * * |
| 6 | * qGo is free software: you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
| 9 | * (at your option) any later version. * |
| 10 | * * |
| 11 | * This program 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 General Public License for more details. * |
| 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/> * |
| 18 | * or write to the Free Software Foundation, Inc., * |
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | |
| 23 | #include <QtWidgets> |
| 24 | #include "codecwarndialog.h"cxx . . $ `<file>/src/network/codecwarndialog.h`/ |
| 25 | #include "../defines.h"cxx . . $ `<file>/src/defines.h`/ |
| 26 | |
| 27 | CodecWarnDialogcxx . . $ CodecWarnDialog#::CodecWarnDialogcxx . . $ CodecWarnDialog#CodecWarnDialog(85c52e162fed56f9).(const char * encoding) |
| 28 | { |
| 29 | if(!preferencescxx . . $ preferences..warn_about_codecscxx . . $ _preferences#warn_about_codecs.) |
| 30 | { |
| 31 | deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 32 | donecxx . . $ QDialog#done(d4f767463ce0a6b3).(0); |
| 33 | } |
| 34 | /* FIXME okayButton should be on lower right and window should be slightly |
| 35 | * larger, more warning like, maybe with padding around text, some kind of |
| 36 | * layout. */ |
| 37 | okayButtoncxx . . $ CodecWarnDialog#okayButton. = new QPushButtoncxx . . $ QPushButton#QPushButton(90d5708627041e22).(trcxx . . $ CodecWarnDialog#tr(75d9f1c324b4579d).("Okay")); |
| 38 | okayButtoncxx . . $ CodecWarnDialog#okayButton.->setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(80); |
| 39 | okayButtoncxx . . $ CodecWarnDialog#okayButton.->setDefaultcxx . . $ QPushButton#setDefault(b45ddcbc8423892c).(true); |
| 40 | |
| 41 | dontwarnCBcxx . . $ CodecWarnDialog#dontwarnCB. = new QCheckBoxcxx . . $ QCheckBox#(trcxx . . $ CodecWarnDialog#tr(75d9f1c324b4579d).("Don't warn me again")); |
| 42 | |
| 43 | textLabelcxx . . $ CodecWarnDialog#textLabel. = new QLabelcxx . . $ QLabel#(trcxx . . $ CodecWarnDialog#tr(75d9f1c324b4579d).("Can't find font codec \"%1\"\nUsing default").argcxx . . $ QString#arg(bc823072288cbbb5).(encodingcxx . . $ QString#QString(85c52e162fed56f9).)); |
| 44 | |
| 45 | connectcxx . . $ QObject#connect(835f87066c895669).(okayButtoncxx . . $ CodecWarnDialog#okayButton., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., this, &CodecWarnDialogcxx . . $ CodecWarnDialog#::slot_okaycxx . . $ CodecWarnDialog#slot_okay(49f6e7a06ebc5aa8).); |
| 46 | |
| 47 | QGridLayoutcxx . . $ QGridLayout# * mainLayout = new QGridLayoutcxx . . $ QGridLayout#; |
| 48 | //mainLayout->setSizeConstraint(QLayout::SetFixedSize); |
| 49 | mainLayout->addWidgetcxx . . $ QGridLayout#addWidget(17d1465fab362e2d).(textLabelcxx . . $ CodecWarnDialog#textLabel., 0, 0); |
| 50 | mainLayout->addWidgetcxx . . $ QGridLayout#addWidget(17d1465fab362e2d).(dontwarnCBcxx . . $ CodecWarnDialog#dontwarnCB., 1, 0); |
| 51 | mainLayout->addWidgetcxx . . $ QGridLayout#addWidget(17d1465fab362e2d).(okayButtoncxx . . $ CodecWarnDialog#okayButton., 2, 0); |
| 52 | setLayoutcxx . . $ QWidget#setLayout(23396b1058755fec).(mainLayout); |
| 53 | |
| 54 | setWindowTitlecxx . . $ QWidget#setWindowTitle(3520e46b33348bf6).(trcxx . . $ CodecWarnDialog#tr(75d9f1c324b4579d).("Missing Codec!")); |
| 55 | showcxx . . $ QWidget#show(49f6e7a06ebc5aa8).(); |
| 56 | } |
| 57 | |
| 58 | CodecWarnDialogcxx . . $ CodecWarnDialog#::~cxx . . $ CodecWarnDialog#`~CodecWarnDialog`(ced63f7c635d850d).CodecWarnDialogcxx . . $ CodecWarnDialog#() |
| 59 | { |
| 60 | if(dontwarnCBcxx . . $ CodecWarnDialog#dontwarnCB.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).()) |
| 61 | preferencescxx . . $ preferences..warn_about_codecscxx . . $ _preferences#warn_about_codecs. = 0; |
| 62 | delete okayButtoncxx . . $ CodecWarnDialog#okayButton.; |
| 63 | delete dontwarnCBcxx . . $ CodecWarnDialog#dontwarnCB.; |
| 64 | } |
| 65 | |
| 66 | void CodecWarnDialogcxx . . $ CodecWarnDialog#::slot_okaycxx . . $ CodecWarnDialog#slot_okay(49f6e7a06ebc5aa8).(void) |
| 67 | { |
| 68 | /* Why does this need to be here as well as above? FIXME, |
| 69 | * why doesn't it suffice solely in deconstructor */ |
| 70 | if(dontwarnCBcxx . . $ CodecWarnDialog#dontwarnCB.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).()) |
| 71 | preferencescxx . . $ preferences..warn_about_codecscxx . . $ _preferences#warn_about_codecs. = 0; |
| 72 | deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 73 | donecxx . . $ QDialog#done(d4f767463ce0a6b3).(0); |
| 74 | } |