| 125 | } |
| 126 | |
| 127 | void SynchronizerGUI::initGUI(const QString &profileName, QUrl leftURL, QUrl rightURL, QStringList selList) |
| 128 | { |
| 129 | setAttribute(Qt::WA_DeleteOnClose); |
| 130 | |
| 131 | selectedFiles = std::move(selList); |
| 132 | isComparing = wasClosed = wasSync = false; |
| 133 | |
| 134 | hasSelectedFiles = (selectedFiles.count() != 0); |
| 135 | |
| 136 | if (leftURL.isEmpty()) |
| 137 | leftURL = QUrl::fromLocalFile(ROOT_DIR); |
| 138 | if (rightURL.isEmpty()) |
| 139 | rightURL = QUrl::fromLocalFile(ROOT_DIR); |
| 140 | |
| 141 | setWindowTitle(i18n("Krusader::Synchronize Folders")); |
| 142 | auto *synchGrid = new QGridLayout(this); |
| 143 | synchGrid->setSpacing(6); |
| 144 | synchGrid->setContentsMargins(11, 11, 11, 11); |
| 145 | |
| 146 | synchronizerTabs = new QTabWidget(this); |
| 147 | |
| 148 | /* ============================== Compare groupbox ============================== */ |
| 149 | |
| 150 | QWidget *synchronizerTab = new QWidget(this); |
| 151 | auto *synchronizerGrid = new QGridLayout(synchronizerTab); |
| 152 | synchronizerGrid->setSpacing(6); |
| 153 | synchronizerGrid->setContentsMargins(11, 11, 11, 11); |
| 154 | |
| 155 | auto *compareDirs = new QGroupBox(synchronizerTab); |
| 156 | compareDirs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
| 157 | compareDirs->setTitle(i18n("Folder Comparison")); |
| 158 | |
| 159 | auto *grid = new QGridLayout(compareDirs); |
| 160 | grid->setSpacing(6); |
| 161 | grid->setContentsMargins(11, 11, 11, 11); |
| 162 | |
| 163 | leftDirLabel = new QLabel(compareDirs); |
| 164 | leftDirLabel->setAlignment(Qt::AlignHCenter); |
| 165 | grid->addWidget(leftDirLabel, 0, 0); |
| 166 | |
| 167 | QLabel *filterLabel = new QLabel(compareDirs); |
| 168 | filterLabel->setText(i18n("File &Filter:")); |
| 169 | filterLabel->setAlignment(Qt::AlignHCenter); |
| 170 | grid->addWidget(filterLabel, 0, 1); |
| 171 | |
| 172 | rightDirLabel = new QLabel(compareDirs); |
| 173 | rightDirLabel->setAlignment(Qt::AlignHCenter); |
| 174 | grid->addWidget(rightDirLabel, 0, 2); |
| 175 | |
| 176 | KConfigGroup group(krConfig, "Synchronize"); |
| 177 | |
| 178 | leftLocation = new KrHistoryComboBox(false, compareDirs); |
| 179 | leftLocation->setMaxCount(25); // remember 25 items |
| 180 | leftLocation->setDuplicatesEnabled(false); |
| 181 | leftLocation->setEditable(true); |
| 182 | leftLocation->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); |
| 183 | QStringList list = group.readEntry("Left Folder History", QStringList()); |
| 184 | leftLocation->setHistoryItems(list); |
nothing calls this directly
no test coverage detected