~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to plugins/defaultTools/guidestool/InsertGuidesToolOptionWidget.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of the KDE project
2
2
 * Copyright (C) 2009 Carlos Licea <carlos.licea@kdemail.net>
 
3
 * Copyright 2012 Friedrich W. H. Kossebau <kossebau@kde.org>
3
4
 *
4
5
 * This library is free software; you can redistribute it and/or
5
6
 * modify it under the terms of the GNU Library General Public
19
20
 
20
21
#include "InsertGuidesToolOptionWidget.h"
21
22
 
22
 
#include <KIcon>
 
23
#include <KoIcon.h>
23
24
 
24
25
InsertGuidesToolOptionWidget::InsertGuidesToolOptionWidget(QWidget *parent)
25
26
    : QWidget(parent)
26
27
{
27
28
    m_widget.setupUi(this);
28
29
 
29
 
    //FIXME give real icon names
30
 
    m_widget.m_erasePreviousCheckBox->setIcon(KIcon("erase-previous-guides"));
31
 
    m_widget.m_horizontalEdgesCheckBox->setIcon(KIcon("add-horizontal-edges"));
32
 
    m_widget.m_verticalEdgesCheckBox->setIcon(KIcon("add-vertical-edges"));
33
 
 
34
 
    connect(m_widget.m_verticalCheckBox, SIGNAL(toggled(bool)),
35
 
             this, SLOT(verticalCheckBoxSlot(bool)));
36
 
    connect(m_widget.m_horizontalCheckBox, SIGNAL(toggled(bool)),
37
 
             this, SLOT(horizontalCheckBoxSlot(bool)));
 
30
    m_widget.m_horizontalEdgesCheckBox->setIcon(koIconNeeded("add guides at top & bottom side of page","add-horizontal-edges"));
 
31
    m_widget.m_verticalEdgesCheckBox->setIcon(koIconNeeded("add guides at left & right side of page","add-vertical-edges"));
38
32
 
39
33
    connect(m_widget.m_createButton, SIGNAL(clicked(bool)),
40
 
             this, SLOT(createButtonClickedSlot(bool)));
 
34
             this, SLOT(onCreateButtonClicked(bool)));
41
35
}
42
36
 
43
37
InsertGuidesToolOptionWidget::~InsertGuidesToolOptionWidget()
44
38
{
45
39
}
46
40
 
47
 
 
48
 
void InsertGuidesToolOptionWidget::horizontalCheckBoxSlot(bool state)
49
 
{
50
 
    m_widget.m_horizontalSpinBox->setEnabled(state);
51
 
}
52
 
 
53
 
void InsertGuidesToolOptionWidget::verticalCheckBoxSlot(bool state)
54
 
{
55
 
    m_widget.m_verticalSpinBox->setEnabled(state);
56
 
}
57
 
 
58
 
void InsertGuidesToolOptionWidget::createButtonClickedSlot(bool checked)
 
41
void InsertGuidesToolOptionWidget::onCreateButtonClicked(bool checked)
59
42
{
60
43
    Q_UNUSED(checked);
61
44
 
62
45
    GuidesTransaction *transaction = new GuidesTransaction;
63
46
    transaction->erasePreviousGuides = m_widget.m_erasePreviousCheckBox->isChecked();
64
 
    transaction->verticalGuides = (m_widget.m_verticalCheckBox->isChecked())
65
 
        ? m_widget.m_verticalSpinBox->value() : 0;
 
47
    transaction->verticalGuides = m_widget.m_verticalSpinBox->value();
66
48
    transaction->insertVerticalEdgesGuides = m_widget.m_verticalEdgesCheckBox->isChecked();
67
 
    transaction->horizontalGuides = (m_widget.m_horizontalCheckBox->isChecked())
68
 
        ? m_widget.m_horizontalSpinBox->value() : 0;
 
49
    transaction->horizontalGuides = m_widget.m_horizontalSpinBox->value();
69
50
    transaction->insertHorizontalEdgesGuides = m_widget.m_horizontalEdgesCheckBox->isChecked();
70
51
 
71
52
    emit createGuides(transaction);