Don't call completeInit from here it will be called in KDiff3Shell as needed. */
| 113 | Don't call completeInit from here it will be called in KDiff3Shell as needed. |
| 114 | */ |
| 115 | KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Shell* pKDiff3Shell, const FileNames& names): |
| 116 | QMainWindow(pParent) |
| 117 | { |
| 118 | setWindowFlags(Qt::Widget); |
| 119 | setObjectName(name); |
| 120 | m_pKDiff3Shell = pKDiff3Shell; |
| 121 | |
| 122 | //Get SourceData objects intalized as soon as possiable or wierd errors can happen on startup. |
| 123 | if(!names.fn1.isEmpty()) |
| 124 | { |
| 125 | m_sd1->setFilename(names.fn1); |
| 126 | m_bDirCompare = m_sd1->isDir(); |
| 127 | } |
| 128 | if(!names.fn2.isEmpty()) |
| 129 | { |
| 130 | m_sd2->setFilename(names.fn2); |
| 131 | } |
| 132 | if(!names.fn3.isEmpty()) |
| 133 | { |
| 134 | m_sd3->setFilename(names.fn3); |
| 135 | } |
| 136 | |
| 137 | m_pCentralWidget = new QWidget(this); |
| 138 | QVBoxLayout* pCentralLayout = new QVBoxLayout(m_pCentralWidget); |
| 139 | pCentralLayout->setContentsMargins(0, 0, 0, 0); |
| 140 | pCentralLayout->setSpacing(0); |
| 141 | setCentralWidget(m_pCentralWidget); |
| 142 | |
| 143 | m_pMainWidget = new QWidget(m_pCentralWidget); |
| 144 | m_pMainWidget->setObjectName("MainWidget"); |
| 145 | pCentralLayout->addWidget(m_pMainWidget); |
| 146 | m_pMainWidget->hide(); |
| 147 | |
| 148 | setWindowTitle("KDiff3"); |
| 149 | setUpdatesEnabled(false); |
| 150 | |
| 151 | // set Disabled to same color as enabled to prevent flicker in DirectoryMergeWindow |
| 152 | QPalette pal; |
| 153 | pal.setBrush(QPalette::Base, pal.brush(QPalette::Active, QPalette::Base)); |
| 154 | pal.setColor(QPalette::Text, pal.color(QPalette::Active, QPalette::Text)); |
| 155 | setPalette(pal); |
| 156 | |
| 157 | // Setup progress ProgressDialog. No progress can be shown before this point. |
| 158 | // ProgressProxy will otherwise emit no-ops to disconnected boost signals. |
| 159 | if(g_pProgressDialog == nullptr) |
| 160 | { |
| 161 | g_pProgressDialog = new ProgressDialog(this, statusBar()); |
| 162 | g_pProgressDialog->setStayHidden(true); |
| 163 | } |
| 164 | |
| 165 | // All default values must be set before calling readOptions(). |
| 166 | m_pOptionDialog = new OptionDialog(m_pKDiff3Shell != nullptr, this); |
| 167 | chk_connect_a(m_pOptionDialog, &OptionDialog::applyDone, this, &KDiff3App::slotRefresh); |
| 168 | |
| 169 | m_pOptionDialog->readOptions(KSharedConfig::openConfig()); |
| 170 | |
| 171 | // Option handling. |
| 172 | qsizetype argCount = KDiff3Shell::getParser()->optionNames().count() + KDiff3Shell::getParser()->positionalArguments().count(); |
nothing calls this directly
no test coverage detected