~ubuntu-branches/ubuntu/quantal/qgo/quantal

« back to all changes in this revision

Viewing changes to src/tip.cpp

  • Committer: Package Import Robot
  • Author(s): Yann Dirson
  • Date: 2012-05-19 19:05:05 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120519190505-lf69o1jee5aaizd9
Tags: 2~svn764-1
* The "Raise dead" release (Closes: #673520), new maintainer.
* New upstream snapshot with Qt4 support (Closes: #604589), adjusted
  build-deps.
* Switched to source format "3.0 (quilt)", adjusted build-deps.
* Switched to dh and debhelper compat level 9, adjusted build-deps.
* Build with -fpermissive.
* New build-dep libasound2-dev, remove obsolete build-dep on libxinerama-dev.
* Refreshed patches 01_gnugo and 04_desktop, leaving 20_kfreebsd away
  for this release, and removing the remaining ones, now obsolete.
* Added patch 02_usrgames for FHS-correct install location.
* Adjusted icon names in menu file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
* tip.cpp
3
 
*/
4
 
 
5
 
#include "tip.h"
6
 
#include "board.h"
7
 
#include "qgo.h"
8
 
 
9
 
/*
10
 
* Tip
11
 
*/
12
 
/* UNUSED
13
 
Tip::Tip(QWidget *parent)
14
 
: QToolTip(parent)
15
 
{
16
 
}
17
 
 
18
 
Tip::~Tip()
19
 
{
20
 
}
21
 
 
22
 
void Tip::maybeTip(const QPoint &pos)
23
 
{
24
 
        if (!setting->readBoolEntry("BOARD_COORDS_TIP"))
25
 
                return;
26
 
        
27
 
        int x = ((Board*)parentWidget())->getCurrentX(),
28
 
                y = ((Board*)parentWidget())->getCurrentY();
29
 
        
30
 
        if (x == -1 || y == -1)
31
 
                return;
32
 
        
33
 
        tip(QRect(pos.x(), pos.y(), 1, 1),
34
 
                QString(QChar(static_cast<const char>('A' + (x<9?x:x+1) - 1))) +       // A -> T (skip I)
35
 
                " " + QString::number(((Board*)parentWidget())->getBoardSize()-y+1));  // 19 -> 1
36
 
}
37
 
*/
38
 
 
39
 
/*
40
 
* StatusTip
41
 
*/
42
 
 
43
 
StatusTip::StatusTip(QWidget *parent)
44
 
: QLabel(parent)
45
 
{
46
 
        setAlignment(AlignCenter | SingleLine);
47
 
}
48
 
 
49
 
StatusTip::~StatusTip()
50
 
{
51
 
}
52
 
 
53
 
void StatusTip::slotStatusTipCoords(int x, int y, int board_size, bool SGFCoords)
54
 
{
55
 
        emit clearStatusBar();
56
 
        QString t1,t2;  
57
 
 
58
 
 
59
 
        if(SGFCoords)
60
 
        {
61
 
                t1 = QString(QChar(static_cast<const char>('a' + x-1)));
62
 
                t2 = QString(QChar(static_cast<const char>('a' + y-1)));
63
 
        }
64
 
        else
65
 
        {
66
 
                t1 = QString(QChar(static_cast<const char>('A' + (x<9?x:x+1) - 1)));
67
 
                t2 = QString::number(board_size - y+1);
68
 
        }
69
 
 
70
 
        setText(" " + t1 + //QString(QChar(static_cast<const char>('A' + (x<9?x:x+1) - 1))) +       // A -> T (skip I)
71
 
                " " + t2 +//QString::number(board_size-y+1) + 
72
 
                " ");   
73
 
 
74
 
 
75
 
 
76
 
 
77
 
                             // 19 -> 1
78
 
}