~ubuntu-branches/ubuntu/feisty/digikam/feisty

« back to all changes in this revision

Viewing changes to digikamcameraclient/digikamcameraclient.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Achim Bohnet
  • Date: 2005-03-10 02:39:02 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050310023902-023nymfst5mg696c
Tags: 0.7.2-2
* debian/TODO: clean
* digikam manpage: better --detect-camera description

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ============================================================
2
 
 * File  : digikamcameraclient.cpp
3
 
 * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
4
 
 * Date  : 2003-02-18
5
 
 * Description : 
6
 
 * 
7
 
 * Copyright 2003 by Renchi Raju
8
 
 
9
 
 * This program is free software; you can redistribute it
10
 
 * and/or modify it under the terms of the GNU General
11
 
 * Public License as published bythe Free Software Foundation;
12
 
 * either version 2, or (at your option)
13
 
 * any later version.
14
 
 * 
15
 
 * This program is distributed in the hope that it will be useful,
16
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 * GNU General Public License for more details.
19
 
 * 
20
 
 * ============================================================ */
21
 
 
22
 
#include <kapplication.h>
23
 
#include <klocale.h>
24
 
 
25
 
#include "digikamcameraclient.h"
26
 
 
27
 
#include "cameratype.h"
28
 
#include "cameraui.h"
29
 
 
30
 
DigikamCameraClient::DigikamCameraClient()
31
 
    : QObject(),
32
 
      DCOPObject("DigikamCameraClient")
33
 
{
34
 
    mCurrentUI = 0;
35
 
}
36
 
 
37
 
DigikamCameraClient::~DigikamCameraClient()
38
 
{
39
 
    
40
 
}
41
 
 
42
 
ASYNC DigikamCameraClient::cameraOpen(QString libraryPath, QString downloadAlbum,
43
 
                                      QString title, QString model,
44
 
                                      QString port, QString path)
45
 
{
46
 
    if (mCurrentUI) return;
47
 
    
48
 
    // Make sure to ref the app so that we don't
49
 
    // exit when camerui kmainwindow derefs at exit
50
 
    kapp->ref();
51
 
 
52
 
    CameraType ctype(title, model, port, path);
53
 
    CameraUI *cameraUI = new CameraUI(libraryPath, downloadAlbum, ctype);
54
 
    connect(cameraUI, SIGNAL(signalFinished()),
55
 
            this,     SLOT(slotCameraUIFinished()));
56
 
 
57
 
    cameraUI->show();
58
 
 
59
 
    mCurrentUI = cameraUI;
60
 
}
61
 
 
62
 
ASYNC DigikamCameraClient::cameraConnect()
63
 
{
64
 
    if (!mCurrentUI) return;
65
 
 
66
 
    mCurrentUI->connectCamera();
67
 
}
68
 
 
69
 
ASYNC DigikamCameraClient::cameraChangeLibraryPath(QString libraryPath)
70
 
{
71
 
    if (!mCurrentUI) return;
72
 
 
73
 
    mCurrentUI->changeLibraryPath(libraryPath);
74
 
}
75
 
 
76
 
ASYNC DigikamCameraClient::cameraChangeDownloadAlbum(QString album)
77
 
{
78
 
    if (!mCurrentUI) return;
79
 
 
80
 
    mCurrentUI->changeDownloadAlbum(album);
81
 
}
82
 
 
83
 
ASYNC DigikamCameraClient::cameraDownloadSelected()
84
 
{
85
 
    if (!mCurrentUI) return;
86
 
 
87
 
    mCurrentUI->downloadSelected();
88
 
}
89
 
 
90
 
void DigikamCameraClient::close()
91
 
{
92
 
    if (mCurrentUI) {
93
 
        mCurrentUI->close();
94
 
        mCurrentUI = 0;
95
 
    }
96
 
 
97
 
    kapp->deref();    
98
 
}
99
 
 
100
 
void DigikamCameraClient::slotCameraUIFinished()
101
 
{
102
 
    mCurrentUI = 0;
103
 
}
104