~ubuntu-branches/debian/sid/kdesvn/sid

« back to all changes in this revision

Viewing changes to src/kdesvn_part.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2006-10-27 12:52:15 UTC
  • mfrom: (1.2.1 upstream) (5.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20061027125215-aifcjirifidnegx5
Tags: 0.11.0-1
* New upstream release.
* debian/patches/01-kompare_diff.patch
  + Removed. Fixed upstream.
* debian/control
  + Add a "Suggests: kdiff3" to kdesvn. kdiff3 can be used as an external
    merge program.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 ***************************************************************************/
20
20
 
21
21
#include "kdesvn_part.h"
22
 
#include "svnfrontend/fronthelpers/settings.h"
23
 
#include "svnfrontend/displaysettings_impl.h"
24
 
#include "svnfrontend/dispcolorsettings_impl.h"
25
 
#include "subversionsettings_impl.h"
 
22
#include "src/settings/kdesvnsettings.h"
 
23
#include "settings/displaysettings_impl.h"
 
24
#include "settings/dispcolorsettings_impl.h"
 
25
#include "settings/revisiontreesettingsdlg_impl.h"
 
26
#include "settings/diffmergesettings_impl.h"
 
27
#include "settings/subversionsettings_impl.h"
 
28
#include "settings/cmdexecsettings_impl.h"
26
29
#include "kdesvnview.h"
27
30
#include "commandline_part.h"
28
 
#include "../config.h"
29
 
#include "svncpp/version_check.hpp"
30
 
#include "svncpp/url.hpp"
 
31
#include "src/svnqt/version_check.hpp"
 
32
#include "src/svnqt/url.hpp"
31
33
#include "helpers/ktranslateurl.h"
 
34
#include "helpers/sshagent.h"
32
35
 
33
36
#include <kinstance.h>
34
37
#include <kaction.h>
46
49
#include <qcursor.h>
47
50
#include <qpopupmenu.h>
48
51
 
49
 
K_EXPORT_COMPONENT_FACTORY( libkdesvnpart, kdesvnPartFactory )
 
52
//K_EXPORT_COMPONENT_FACTORY( libkdesvnpart, kdesvnPartFactory )
 
53
 
 
54
extern "C" { KDESVN_EXPORT void *init_libkdesvnpart() { return new kdesvnPartFactory; } }
50
55
 
51
56
static const char version[] = VERSION;
52
57
QString kdesvnPart::m_Extratext = "";
79
84
#else
80
85
    setXMLFile("kdesvn_part.rc");
81
86
#endif
82
 
    connect(m_view,SIGNAL(sigShowPopup(const QString&)),this,SLOT(slotDispPopup(const QString&)));
 
87
    connect(m_view,SIGNAL(sigShowPopup(const QString&,QWidget**)),this,SLOT(slotDispPopup(const QString&,QWidget**)));
83
88
    connect(m_view,SIGNAL(sigSwitchUrl(const KURL&)),this,SLOT(openURL(const KURL&)));
84
89
    connect(this,SIGNAL(refreshTree()),m_view,SLOT(refreshCurrentTree()));
85
90
    connect(m_view,SIGNAL(setWindowCaption(const QString&)),this,SIGNAL(setWindowCaption(const QString&)));
 
91
    connect(m_view,SIGNAL(sigUrlChanged( const QString&)),this,SLOT(slotUrlChanged(const QString&)));
86
92
    m_browserExt->setPropertiesActionEnabled(false);
87
93
}
88
94
 
91
97
    kdesvnPartFactory::instance()->config()->sync();
92
98
}
93
99
 
 
100
void kdesvnPart::slotUrlChanged(const QString&url)
 
101
{
 
102
    m_url = url;
 
103
}
 
104
 
94
105
bool kdesvnPart::openFile()
95
106
{
96
107
    m_view->openURL(m_url);
124
135
{
125
136
}
126
137
 
127
 
void kdesvnPart::slotDispPopup(const QString&name)
 
138
void kdesvnPart::slotDispPopup(const QString&name,QWidget**target)
128
139
{
129
 
    QWidget *w = hostContainer(name);
130
 
    QPopupMenu *popup = static_cast<QPopupMenu *>(w);
131
 
    if (!popup) {
132
 
        kdDebug()<<"Error getting popupMenu"<<endl;
133
 
        return;
134
 
    }
135
 
    popup->exec(QCursor::pos());
 
140
    *target = hostContainer(name);
136
141
}
137
142
 
138
143
KAboutData* kdesvnPart::createAboutData()
161
166
    KToggleAction *toggletemp;
162
167
    toggletemp = new KToggleAction(i18n("Use \"Kompare\" for displaying diffs"),KShortcut(),
163
168
            actionCollection(),"toggle_use_kompare");
164
 
    toggletemp->setChecked(Settings::use_kompare_for_diff());
 
169
    toggletemp->setChecked(Kdesvnsettings::use_kompare_for_diff());
165
170
    connect(toggletemp,SIGNAL(toggled(bool)),this,SLOT(slotUseKompare(bool)));
166
171
 
167
172
    toggletemp = new KToggleAction(i18n("Logs follow node changes"),KShortcut(),
168
173
            actionCollection(),"toggle_log_follows");
169
 
    toggletemp->setChecked(Settings::log_follows_nodes());
 
174
    toggletemp->setChecked(Kdesvnsettings::log_follows_nodes());
170
175
    connect(toggletemp,SIGNAL(toggled(bool)),this,SLOT(slotLogFollowNodes(bool)));
171
176
 
172
177
    toggletemp = new KToggleAction(i18n("Display ignored files"),KShortcut(),
173
178
            actionCollection(),"toggle_ignored_files");
174
 
    toggletemp->setChecked(Settings::display_ignored_files());
 
179
    toggletemp->setChecked(Kdesvnsettings::display_ignored_files());
175
180
    connect(toggletemp,SIGNAL(toggled(bool)),this,SLOT(slotDisplayIgnored(bool)));
 
181
 
176
182
#if 0
177
183
    /// not needed this moment
178
184
    toggletemp = new KToggleAction(i18n("Display unknown files"),KShortcut(),
193
199
    actionCollection()->setHighlightingEnabled(true);
194
200
}
195
201
 
 
202
void kdesvnPart::slotSshAdd()
 
203
{
 
204
    SshAgent ag;
 
205
    ag.addSshIdentities(true);
 
206
}
196
207
 
197
208
/*!
198
209
    \fn kdesvnPart::slotLogFollowNodes(bool)
199
210
 */
200
211
void kdesvnPart::slotLogFollowNodes(bool how)
201
212
{
202
 
    Settings::setLog_follows_nodes(how);
203
 
    Settings::writeConfig();
 
213
    Kdesvnsettings::setLog_follows_nodes(how);
 
214
    Kdesvnsettings::writeConfig();
204
215
}
205
216
 
206
217
 
209
220
 */
210
221
void kdesvnPart::slotDisplayIgnored(bool how)
211
222
{
212
 
    Settings::setDisplay_ignored_files(how);
213
 
    Settings::writeConfig();
 
223
    Kdesvnsettings::setDisplay_ignored_files(how);
 
224
    Kdesvnsettings::writeConfig();
214
225
    emit refreshTree();
215
226
}
216
227
 
233
244
void kdesvnPart::slotUseKompare(bool how)
234
245
{
235
246
    int selected = how ? 1 : 0;
236
 
    Settings::setUse_kompare_for_diff(selected);
237
 
    Settings::writeConfig();
 
247
    Kdesvnsettings::setUse_kompare_for_diff(selected);
 
248
    Kdesvnsettings::writeConfig();
238
249
}
239
250
 
240
251
 
317
328
    }
318
329
    KConfigDialog *dialog = new KConfigDialog(widget(),
319
330
         "kdesvnpart_settings",
320
 
         Settings::self(),
 
331
         Kdesvnsettings::self(),
321
332
         KDialogBase::IconList);
 
333
    dialog->setHelp("setup","kdesvn");
322
334
    dialog->addPage(new DisplaySettings_impl(0,"general_items"),
323
 
        i18n("General"),"kdesvn",i18n("General"),true);
 
335
        i18n("General"),"configure",i18n("General"),true);
324
336
    dialog->addPage(new SubversionSettings_impl(0,"subversion_items"),
325
337
        i18n("Subversion"),"kdesvn",i18n("Subversion Settings"),true);
 
338
    dialog->addPage(new DiffMergeSettings_impl(0,"diffmerge_items"),
 
339
        i18n("Diff & Merge"),"kdesvnmerge",i18n("Settings for diff and merge"),true);
326
340
    dialog->addPage(new DispColorSettings_impl(0,"color_items"),
327
 
        i18n("Colors"),"kdesvn",i18n("Color Settings"),true);
 
341
        i18n("Colors"),"colorize",i18n("Color Settings"),true);
 
342
    dialog->addPage(new RevisiontreeSettingsDlg_impl(0,"revisiontree_items"),
 
343
        i18n("Revision tree"),"configure",i18n("Revision tree Settings"),true);
 
344
    dialog->addPage(new CmdExecSettings_impl(0,"cmdexec_items"),
 
345
        "KIO/"+i18n("Commandline"),"terminal",i18n("Settings for commandline and KIO execution"),true);
 
346
 
328
347
    connect(dialog,SIGNAL(settingsChanged()),this,SLOT(slotSettingsChanged()));
329
348
    connect(this,SIGNAL(settingsChanged()),widget(),SLOT(slotSettingsChanged()));
330
349
    dialog->show();
339
358
    KAction * temp;
340
359
    temp = actionCollection()->action("toggle_use_kompare");
341
360
    if (temp) {
342
 
        ((KToggleAction*)temp)->setChecked(Settings::use_kompare_for_diff()==1);
 
361
        ((KToggleAction*)temp)->setChecked(Kdesvnsettings::use_kompare_for_diff()==1);
343
362
    }
344
363
    temp = actionCollection()->action("toggle_log_follows");
345
364
    if (temp) {
346
 
        ((KToggleAction*)temp)->setChecked(Settings::log_follows_nodes());
 
365
        ((KToggleAction*)temp)->setChecked(Kdesvnsettings::log_follows_nodes());
347
366
    }
348
367
    temp = actionCollection()->action("toggle_ignored_files");
349
368
    if (temp) {
350
 
        ((KToggleAction*)temp)->setChecked(Settings::display_ignored_files());
 
369
        ((KToggleAction*)temp)->setChecked(Kdesvnsettings::display_ignored_files());
351
370
    }
352
371
#if 0
353
372
    /// not needed this momenta
369
388
                                                        QObject *parent, const char *name,
370
389
                                                        const char *classname, const QStringList &args )
371
390
{
 
391
    Q_UNUSED(classname);
372
392
    // Create an instance of our Part
373
393
    kdesvnPart* obj = new kdesvnPart( parentWidget, widgetName, parent, name, args );
374
394
    return obj;