File indexing completed on 2024-04-21 04:32:08
0001 /* 0002 * Copyright (C) 2010-2015 by Stephen Allewell 0003 * steve.allewell@gmail.com 0004 * 0005 * This program is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2 of the License, or 0008 * (at your option) any later version. 0009 */ 0010 0011 #include "LibraryFilePathsDlg.h" 0012 0013 #include <KConfigGroup> 0014 #include <KHelpClient> 0015 #include <KLocalizedString> 0016 #include <KSharedConfig> 0017 0018 LibraryFilePathsDlg::LibraryFilePathsDlg(QWidget *parent, const QString &, QStringList paths) 0019 : QDialog(parent) 0020 { 0021 setWindowTitle(i18n("Library File Paths")); 0022 ui.setupUi(this); 0023 0024 QStringListIterator pathIterator(paths); 0025 0026 while (pathIterator.hasNext()) { 0027 ui.PathList->addItem(pathIterator.next()); 0028 } 0029 } 0030 0031 void LibraryFilePathsDlg::hideEvent(QHideEvent *event) 0032 { 0033 KConfigGroup(KSharedConfig::openConfig(), QStringLiteral("DialogSizes")).writeEntry(QStringLiteral("LibraryFilePathsDlg"), size()); 0034 0035 QDialog::hideEvent(event); 0036 } 0037 0038 void LibraryFilePathsDlg::showEvent(QShowEvent *event) 0039 { 0040 QDialog::showEvent(event); 0041 0042 if (KConfigGroup(KSharedConfig::openConfig(), QStringLiteral("DialogSizes")).hasKey(QStringLiteral("LibraryFilePathsDlg"))) { 0043 resize(KConfigGroup(KSharedConfig::openConfig(), QStringLiteral("DialogSizes")).readEntry(QStringLiteral("LibraryFilePathsDlg"), QSize())); 0044 } 0045 } 0046 0047 void LibraryFilePathsDlg::on_DialogButtonBox_accepted() 0048 { 0049 accept(); 0050 } 0051 0052 void LibraryFilePathsDlg::on_DialogButtonBox_helpRequested() 0053 { 0054 KHelpClient::invokeHelp(QStringLiteral("LibraryPaths"), QStringLiteral("kxstitch")); 0055 } 0056 0057 #include "moc_LibraryFilePathsDlg.cpp"