| 133 | } |
| 134 | |
| 135 | ExtenWindow::ExtenWindow(QWidget* parent) : QMainWindow(parent, Qt::WindowCloseButtonHint) |
| 136 | { |
| 137 | This = this; |
| 138 | ui.setupUi(this); |
| 139 | ui.vboxLayout->addWidget(new QLabel(EXTEN_WINDOW_INSTRUCTIONS, this)); |
| 140 | setWindowTitle(EXTENSIONS); |
| 141 | |
| 142 | connect(ui.extenList, &QListWidget::customContextMenuRequested, ContextMenu); |
| 143 | ui.extenList->installEventFilter(this); |
| 144 | |
| 145 | if (!QFile::exists(EXTEN_SAVE_FILE)) QTextFile(EXTEN_SAVE_FILE, QIODevice::WriteOnly).write(DEFAULT_EXTENSIONS); |
| 146 | for (auto extenName : QString(QTextFile(EXTEN_SAVE_FILE, QIODevice::ReadOnly).readAll()).split(">")) Load(extenName); |
| 147 | Sync(); |
| 148 | } |
| 149 | |
| 150 | bool ExtenWindow::eventFilter(QObject* target, QEvent* event) |
| 151 | { |