~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to src/main/CTrayIcon.cpp

  • Committer: Nathan Osman
  • Date: 2012-06-30 18:21:50 UTC
  • Revision ID: admin@quickmediasolutions.com-20120630182150-avavhqs8km192915
New share boxes are now properly positioned when added to the desktop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <dialogs/CSettingsDialog.h>
26
26
#include <file/CFileSender.h>
27
27
#include <main/CTrayIcon.h>
 
28
#include <util/defaults.h>
28
29
#include <util/settings.h>
29
30
 
30
31
CTrayIcon::CTrayIcon()
79
80
        if(machines.contains(dialog.GetMachineID()))
80
81
            name = machines[dialog.GetMachineID()].name;
81
82
 
82
 
        CreateShareBox(dialog.GetMachineID(), name);
 
83
        /* Determine where to put this new box. */
 
84
        QPoint pos;
 
85
        if(m_shareboxes.size())
 
86
        {
 
87
            pos = m_shareboxes.last()->pos();
 
88
            pos.setX(pos.x() - 146);
 
89
        }
 
90
        else
 
91
            pos = Defaults::GetDefaultShareBoxPos();
 
92
 
 
93
        CShareBox * box = CreateShareBox(dialog.GetMachineID(), name);
 
94
        box->move(pos);
 
95
 
83
96
        UpdateShareBoxes();
84
97
    }
85
98
}