Work on wxUI and UsersDialog

This commit is contained in:
2011-09-04 11:21:30 +02:00
parent e6ff989bfa
commit f6e0f92ad7
7 changed files with 224 additions and 49 deletions

View File

@@ -34,6 +34,7 @@
#include "grid/wxGridCellButtonEditor.hpp"
*/
#include "wxUI.hpp"
#include "view.hpp"
#include "UsersDialog.hpp"
@@ -55,31 +56,33 @@ wxUI::wxUI(KissCount* kiss, const QString& title)
: QFrame(0), _kiss(kiss),
_curPanel(0), _locale(0), _needReload(false)
{
QPushButton* button;
setWindowTitle(title);
// _vbox = new wxBoxSizer(wxVERTICAL);
// _buttonsBox = new wxBoxSizer(wxHORIZONTAL);
// // ButtonPanel* buttons = new ButtonPanel(_kiss, this);
// // wxMenu *menuFile = new wxMenu;
_vbox = new QVBoxLayout;
_buttonsBox = new QHBoxLayout;
// // menuFile->Append( ID_About, wxT("&About...") );
// // menuFile->AppendSeparator();
// // menuFile->Append( ID_Quit, wxT("E&xit") );
button = new QPushButton(QIcon(CHANGE_USER_ICON), "", this);
button->setFixedSize(128, 128);
button->setIconSize(QSize(128, 128));
connect(button, SIGNAL(clicked()), this, SLOT(OnButtonChangeUser()));
_buttonsBox->addWidget(button);
// // wxMenuBar *menuBar = new wxMenuBar;
// // menuBar->Append( menuFile, wxT("&File") );
button = new QPushButton(QIcon(ABOUT_ICON), "", this);
button->setFixedSize(128, 128);
button->setIconSize(QSize(128, 128));
connect(button, SIGNAL(clicked()), this, SLOT(OnButtonAbout()));
_buttonsBox->addWidget(button);
// // SetMenuBar( menuBar );
button = new QPushButton(QIcon(QUIT_ICON), "", this);
button->setFixedSize(128, 128);
button->setIconSize(QSize(128, 128));
connect(button, SIGNAL(clicked()), this, SLOT(OnButtonQuit()));
_buttonsBox->addWidget(button);
// // CreateStatusBar();
// // SetStatusText( wxT("Welcome to wxWidgets!") );
// _buttonsBox->Add(new wxBitmapButton(this, BUTTON_CHANGE_USER_ID, wxBitmap(wxT(CHANGE_USER_ICON), wxBITMAP_TYPE_PNG), wxDefaultPosition, wxSize(128, 128)));
// _buttonsBox->Add(new wxBitmapButton(this, BUTTON_ABOUT_ID, wxBitmap(wxT(ABOUT_ICON), wxBITMAP_TYPE_PNG), wxDefaultPosition, wxSize(128, 128)));
// _buttonsBox->Add(new wxBitmapButton(this, BUTTON_QUIT_ID, wxBitmap(wxT(QUIT_ICON), wxBITMAP_TYPE_PNG), wxDefaultPosition, wxSize(128, 128)));
// SetSizer(_vbox);
// _vbox->Add(_buttonsBox, 0, wxGROW);
_vbox->addLayout(_buttonsBox);
setLayout(_vbox);
}
wxUI::~wxUI()
@@ -129,18 +132,18 @@ bool wxUI::SetLanguage(QString language)
// res = false;
// }
// months[0] = _("january");
// months[1] = _("february");
// months[2] = _("marchpp");
// months[3] = _("april");
// months[4] = _("may");
// months[5] = _("june");
// months[6] = _("july");
// months[7] = _("august");
// months[8] = _("september");
// months[9] = _("october");
// months[10] = _("november");
// months[11] = _("december") ;
months[0] = _("january");
months[1] = _("february");
months[2] = _("marchpp");
months[3] = _("april");
months[4] = _("may");
months[5] = _("june");
months[6] = _("july");
months[7] = _("august");
months[8] = _("september");
months[9] = _("october");
months[10] = _("november");
months[11] = _("december") ;
return res;
}
@@ -258,12 +261,12 @@ void wxUI::ChangeUser()
void wxUI::OnButtonAbout()
{
QMessageBox::information(this, "KissCount " APP_VERSION, _("Personal accounting software\n\nhttp://indefero.soutade.fr/p/kisscount/\n\nLicenced under GNU GPL v3\n\nCopyright (C) 2010-2011 Grégory Soutadé"));
QMessageBox::information(0, "KissCount " APP_VERSION, _("Personal accounting software\n\nhttp://indefero.soutade.fr/p/kisscount/\n\nLicenced under GNU GPL v3\n\nCopyright (C) 2010-2011 Grégory Soutadé"));
}
void wxUI::OnButtonQuit()
{
if (QMessageBox::question(this, "KissCount", _("Quit KissCount ?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
if (QMessageBox::question(0, "KissCount", _("Quit KissCount ?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
close();
}