2010-07-10 16:34:30 +02:00
|
|
|
/*
|
2012-02-01 11:02:54 +01:00
|
|
|
Copyright 2010-2012 Grégory Soutadé
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
This file is part of KissCount.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
KissCount is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
KissCount is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
|
2010-07-10 16:34:30 +02:00
|
|
|
*/
|
|
|
|
|
2011-09-03 20:40:21 +02:00
|
|
|
#include <QMessageBox>
|
|
|
|
|
2011-09-04 19:25:53 +02:00
|
|
|
#include "AccountPanel.hpp"
|
2011-12-03 11:23:55 +01:00
|
|
|
#include "SearchPanel.hpp"
|
2011-12-18 13:51:04 +01:00
|
|
|
#include "PreferencesPanel.hpp"
|
2011-08-20 14:02:47 +02:00
|
|
|
#include "StatsPanel.hpp"
|
2012-02-20 21:27:51 +01:00
|
|
|
#include "ImportPanel.hpp"
|
2012-02-11 14:02:30 +01:00
|
|
|
#include "ExportPanel.hpp"
|
2011-08-20 14:02:47 +02:00
|
|
|
|
|
|
|
#include "wxUI.hpp"
|
2011-09-04 11:21:30 +02:00
|
|
|
#include "view.hpp"
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2011-09-03 10:38:36 +02:00
|
|
|
#include "UsersDialog.hpp"
|
|
|
|
|
2012-06-29 20:33:33 +02:00
|
|
|
#include <QDesktopWidget>
|
|
|
|
|
2011-08-27 18:35:36 +02:00
|
|
|
QString wxUI::months[12] ;
|
2011-08-25 17:45:41 +02:00
|
|
|
QColor wxUI::categoryColors[MAX_CATEGORY] = {QColor(0x00, 0x45, 0x86),
|
|
|
|
QColor(0xFF, 0x3E, 0x0E),
|
|
|
|
QColor(0xFF, 0xD3, 0x20),
|
|
|
|
QColor(0x58, 0x9D, 0x1B),
|
|
|
|
QColor(0x7E, 0x00, 0x21),
|
|
|
|
QColor(0x83, 0xCC, 0xFF),
|
|
|
|
QColor(0x31, 0x40, 0x04),
|
|
|
|
QColor(0xB0, 0xCF, 0x00),
|
|
|
|
QColor(0x4B, 0x1F, 0x6F),
|
|
|
|
QColor(0xFF, 0x93, 0x0E),
|
|
|
|
QColor(0xC5, 0x00, 0x0D),
|
|
|
|
QColor(0x00, 0x84, 0xD1)};
|
|
|
|
|
|
|
|
wxUI::wxUI(KissCount* kiss, const QString& title)
|
2012-02-26 14:24:04 +01:00
|
|
|
: QFrame(0), _language(SupportedLanguages::languages[SupportedLanguages::English].name),
|
|
|
|
_kiss(kiss), _signalMapper(this), _curPanel(0), _locale(0),
|
2017-10-29 18:21:54 +01:00
|
|
|
_needReload(0)
|
2010-05-14 15:04:01 +02:00
|
|
|
{
|
2011-09-04 11:21:30 +02:00
|
|
|
QPushButton* button;
|
2012-06-29 20:33:33 +02:00
|
|
|
QDesktopWidget desk;
|
|
|
|
bool lowRes;
|
|
|
|
int w;
|
|
|
|
|
|
|
|
lowRes = (desk.availableGeometry().width() <= 1024);
|
2011-02-05 21:02:03 +01:00
|
|
|
|
2012-02-26 14:24:04 +01:00
|
|
|
SetLanguage("");
|
2010-12-20 19:28:24 +01:00
|
|
|
|
2011-09-04 11:21:30 +02:00
|
|
|
setWindowTitle(title);
|
2011-09-04 19:25:53 +02:00
|
|
|
|
|
|
|
connect(&_signalMapper, SIGNAL(mapped(int)), this, SLOT(OnButtonClicked(int)));
|
2010-12-20 19:28:24 +01:00
|
|
|
|
2011-09-04 11:21:30 +02:00
|
|
|
_vbox = new QVBoxLayout;
|
|
|
|
_buttonsBox = new QHBoxLayout;
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2012-06-29 20:33:33 +02:00
|
|
|
w = (lowRes) ? 64 : 128;
|
|
|
|
|
|
|
|
button = new QPushButton(QIcon(lowRes ? CHANGE_USER_LOW_ICON : CHANGE_USER_ICON), "", this);
|
|
|
|
button->setFixedSize(w, w);
|
|
|
|
button->setIconSize(QSize(w, w));
|
2011-09-04 11:21:30 +02:00
|
|
|
connect(button, SIGNAL(clicked()), this, SLOT(OnButtonChangeUser()));
|
|
|
|
_buttonsBox->addWidget(button);
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2012-06-29 20:33:33 +02:00
|
|
|
button = new QPushButton(QIcon(lowRes ? ABOUT_LOW_ICON : ABOUT_ICON), "", this);
|
|
|
|
button->setFixedSize(w, w);
|
|
|
|
button->setIconSize(QSize(w, w));
|
2011-09-04 11:21:30 +02:00
|
|
|
connect(button, SIGNAL(clicked()), this, SLOT(OnButtonAbout()));
|
|
|
|
_buttonsBox->addWidget(button);
|
2010-12-20 19:28:24 +01:00
|
|
|
|
2012-06-29 20:33:33 +02:00
|
|
|
button = new QPushButton(QIcon(lowRes ? QUIT_LOW_ICON : QUIT_ICON), "", this);
|
|
|
|
button->setFixedSize(w, w);
|
|
|
|
button->setIconSize(QSize(w, w));
|
2011-09-04 11:21:30 +02:00
|
|
|
connect(button, SIGNAL(clicked()), this, SLOT(OnButtonQuit()));
|
|
|
|
_buttonsBox->addWidget(button);
|
2010-12-20 19:28:24 +01:00
|
|
|
|
2011-09-04 11:21:30 +02:00
|
|
|
_vbox->addLayout(_buttonsBox);
|
|
|
|
setLayout(_vbox);
|
2010-05-14 15:04:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
wxUI::~wxUI()
|
|
|
|
{
|
2010-12-20 19:28:24 +01:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i=0; i<(int)_panels.size(); i++)
|
2011-09-04 19:25:53 +02:00
|
|
|
_buttons[i]->disconnect(&_signalMapper, SLOT(map()));
|
2010-12-20 19:28:24 +01:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
if (_locale) delete _locale;
|
2010-07-04 19:39:39 +02:00
|
|
|
}
|
|
|
|
|
2011-08-27 18:35:36 +02:00
|
|
|
bool wxUI::SetLanguage(QString language)
|
2010-07-04 19:39:39 +02:00
|
|
|
{
|
2010-08-26 21:28:15 +02:00
|
|
|
bool res = true;
|
2012-02-26 14:24:04 +01:00
|
|
|
int i;
|
2010-07-07 21:04:38 +02:00
|
|
|
|
2012-02-26 14:24:04 +01:00
|
|
|
if (_locale)
|
2010-07-04 19:39:39 +02:00
|
|
|
{
|
2012-02-26 14:24:04 +01:00
|
|
|
if (language == _language) return true;
|
2010-07-04 19:39:39 +02:00
|
|
|
}
|
|
|
|
|
2012-02-26 14:24:04 +01:00
|
|
|
if (language == "")
|
2010-07-04 19:39:39 +02:00
|
|
|
{
|
2012-02-26 14:24:04 +01:00
|
|
|
QLocale default_locale = QLocale::system();
|
2010-07-07 21:04:38 +02:00
|
|
|
|
2012-02-26 14:24:04 +01:00
|
|
|
for(i=0; i<SupportedLanguages::NB_SUPPORTED_LANGUAGES; i++)
|
|
|
|
{
|
|
|
|
if (default_locale.language() == SupportedLanguages::languages[i].language)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == SupportedLanguages::NB_SUPPORTED_LANGUAGES)
|
|
|
|
i = SupportedLanguages::English;
|
|
|
|
language = SupportedLanguages::languages[i].name;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(i=0; i<SupportedLanguages::NB_SUPPORTED_LANGUAGES; i++)
|
|
|
|
{
|
|
|
|
if (language == SupportedLanguages::languages[i].name)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == SupportedLanguages::NB_SUPPORTED_LANGUAGES)
|
|
|
|
return false;
|
|
|
|
}
|
2010-07-07 21:04:38 +02:00
|
|
|
|
2012-02-26 14:24:04 +01:00
|
|
|
if (_locale)
|
|
|
|
{
|
|
|
|
delete _locale;
|
|
|
|
_kiss->removeTranslator(&_translator);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i != SupportedLanguages::English)
|
|
|
|
{
|
2015-06-20 18:22:51 +02:00
|
|
|
if (!_translator.load(SupportedLanguages::languages[i].filename, RESOURCES_ROOT "po"))
|
2012-02-26 14:24:04 +01:00
|
|
|
{
|
|
|
|
i = SupportedLanguages::English;
|
2015-06-20 18:22:51 +02:00
|
|
|
_translator.load(SupportedLanguages::languages[i].filename, RESOURCES_ROOT "po");
|
2012-02-26 14:24:04 +01:00
|
|
|
_language = SupportedLanguages::languages[i].name;
|
|
|
|
res = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
_kiss->installTranslator(&_translator);
|
2010-07-04 19:39:39 +02:00
|
|
|
}
|
|
|
|
|
2012-02-26 14:24:04 +01:00
|
|
|
_language = SupportedLanguages::languages[i].language;
|
2012-03-27 21:12:55 +02:00
|
|
|
_curLanguage = SupportedLanguages::languages[i];
|
2012-02-26 14:24:04 +01:00
|
|
|
|
|
|
|
_locale = new QLocale(SupportedLanguages::languages[i].language);
|
|
|
|
QLocale::setDefault(*_locale);
|
2012-02-11 12:48:19 +01:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
months[0] = _("january");
|
|
|
|
months[1] = _("february");
|
|
|
|
months[2] = _("march");
|
|
|
|
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;
|
2010-05-14 15:04:01 +02:00
|
|
|
}
|
|
|
|
|
2011-09-04 19:25:53 +02:00
|
|
|
#define ADD_PANEL(panelName) \
|
2012-06-29 20:33:33 +02:00
|
|
|
panel = new panelName(_kiss, this, lowRes); \
|
2011-09-04 19:25:53 +02:00
|
|
|
button = panel->GetButton(); \
|
|
|
|
button->setToolTip(panel->GetToolTip()); \
|
|
|
|
_buttonsBox->insertWidget(id, button); \
|
|
|
|
_buttons.insert(_buttons.begin()+id, button); \
|
|
|
|
_panels.push_back(panel); \
|
|
|
|
_signalMapper.setMapping(button, id); \
|
2012-06-29 20:33:33 +02:00
|
|
|
connect(button, SIGNAL(clicked()), &_signalMapper, SLOT(map())); \
|
2011-09-04 19:25:53 +02:00
|
|
|
id++;
|
2010-05-17 18:03:21 +02:00
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
void wxUI::InitPanels()
|
2010-07-14 11:15:48 +02:00
|
|
|
{
|
2010-12-20 19:28:24 +01:00
|
|
|
KissPanel* panel;
|
2011-09-04 19:25:53 +02:00
|
|
|
QPushButton* button;
|
2010-12-20 19:28:24 +01:00
|
|
|
_panels.clear();
|
2011-09-04 19:25:53 +02:00
|
|
|
int id=0;
|
2012-06-29 20:33:33 +02:00
|
|
|
QDesktopWidget desk;
|
|
|
|
bool lowRes;
|
|
|
|
|
|
|
|
lowRes = (desk.availableGeometry().width() <= 1024);
|
2011-08-25 17:45:41 +02:00
|
|
|
|
2011-09-04 19:25:53 +02:00
|
|
|
ADD_PANEL(AccountPanel);
|
2012-02-05 15:54:09 +01:00
|
|
|
ADD_PANEL(StatsPanel);
|
2011-12-03 11:23:55 +01:00
|
|
|
ADD_PANEL(SearchPanel);
|
2011-12-18 13:51:04 +01:00
|
|
|
ADD_PANEL(PreferencesPanel);
|
2012-02-20 21:27:51 +01:00
|
|
|
ADD_PANEL(ImportPanel);
|
2012-02-11 14:02:30 +01:00
|
|
|
ADD_PANEL(ExportPanel);
|
2010-07-14 11:15:48 +02:00
|
|
|
}
|
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
void wxUI::LoadPanels()
|
2010-08-17 18:59:19 +02:00
|
|
|
{
|
2010-12-20 19:28:24 +01:00
|
|
|
std::vector<KissPanel*>::iterator it;
|
|
|
|
KissPanel* temp;
|
|
|
|
int i;
|
2010-08-17 18:59:19 +02:00
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
if (_curPanel)
|
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
_vbox->removeWidget(_curPanel);
|
|
|
|
_curPanel = 0;
|
2010-12-20 19:28:24 +01:00
|
|
|
}
|
2010-05-17 18:03:21 +02:00
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
if (_panels.size())
|
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
for (i=0; i<(int)_panels.size(); i++)
|
|
|
|
{
|
2017-10-29 18:21:54 +01:00
|
|
|
if (i == _needReload) continue;
|
2011-09-04 19:25:53 +02:00
|
|
|
temp = _panels[i]->CreatePanel();
|
|
|
|
_buttons[i]->disconnect(&_signalMapper, SLOT(map()));
|
2012-04-28 10:55:04 +02:00
|
|
|
delete _panels[i];
|
2011-09-04 19:25:53 +02:00
|
|
|
_panels[i] = temp;
|
|
|
|
connect(_buttons[i], SIGNAL(clicked()), &_signalMapper, SLOT(map()));
|
|
|
|
_buttons[i]->setToolTip(temp->GetToolTip());
|
|
|
|
}
|
2010-12-20 19:28:24 +01:00
|
|
|
}
|
|
|
|
else
|
2011-09-04 19:25:53 +02:00
|
|
|
InitPanels();
|
2010-05-14 15:04:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void wxUI::LoadUser()
|
|
|
|
{
|
2010-08-26 21:28:15 +02:00
|
|
|
User* user = _kiss->GetUser();
|
2012-12-16 09:49:51 +01:00
|
|
|
int i;
|
2010-05-17 18:03:21 +02:00
|
|
|
|
2017-10-15 11:36:27 +02:00
|
|
|
if (user->GetLanguage().size())
|
2010-12-20 19:28:24 +01:00
|
|
|
SetLanguage(user->GetLanguage());
|
2012-02-11 12:48:19 +01:00
|
|
|
else
|
|
|
|
SetLanguage(SupportedLanguages::languages[0].name);
|
2010-07-14 11:15:48 +02:00
|
|
|
|
2012-12-16 09:49:51 +01:00
|
|
|
// Sort with translated names
|
|
|
|
std::sort(user->_categories.begin(), user->_categories.end(), Category());
|
|
|
|
for (i=0; i < (int)user->_categories.size(); i++)
|
|
|
|
{
|
|
|
|
user->_categoriesFonts[i] = KissCount::ExtractFont(user->_categories[i].font);
|
|
|
|
}
|
|
|
|
|
2011-08-06 17:30:16 +02:00
|
|
|
LoadPanels();
|
2010-07-14 11:15:48 +02:00
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
if (_panels.size())
|
|
|
|
ShowPanel(_panels[0]);
|
2010-05-17 18:03:21 +02:00
|
|
|
}
|
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
void wxUI::ShowPanel(KissPanel* panel)
|
2010-05-17 18:03:21 +02:00
|
|
|
{
|
2010-12-20 19:28:24 +01:00
|
|
|
int i;
|
2011-02-13 19:30:12 +01:00
|
|
|
User* user = _kiss->GetUser();
|
2010-06-27 21:39:49 +02:00
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
if (!panel) return;
|
2010-05-17 18:03:21 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
if (_curPanel)
|
2010-05-17 18:03:21 +02:00
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
_vbox->removeWidget(_curPanel);
|
|
|
|
_curPanel->hide();
|
2010-05-17 18:03:21 +02:00
|
|
|
}
|
2010-07-07 21:04:38 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
if (_needReload)
|
2010-07-04 16:33:25 +02:00
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
user->InvalidateOperations();
|
|
|
|
for(i=0; i<(int)_panels.size(); i++)
|
|
|
|
if (_panels[i] == panel) break;
|
|
|
|
LoadPanels();
|
2017-10-29 18:21:54 +01:00
|
|
|
_needReload = 0;
|
2011-09-04 19:25:53 +02:00
|
|
|
_curPanel = _panels[i];
|
2010-07-04 16:33:25 +02:00
|
|
|
}
|
2010-12-20 19:28:24 +01:00
|
|
|
else
|
2011-09-04 19:25:53 +02:00
|
|
|
_curPanel = panel;
|
2010-06-27 21:39:49 +02:00
|
|
|
|
2011-09-04 19:25:53 +02:00
|
|
|
_curPanel->OnShow();
|
|
|
|
_vbox->addWidget(_curPanel);
|
|
|
|
_curPanel->show();
|
|
|
|
layout();
|
2010-05-14 15:04:01 +02:00
|
|
|
}
|
2010-06-23 19:32:42 +02:00
|
|
|
|
2011-09-04 19:25:53 +02:00
|
|
|
void wxUI::OnButtonClicked(int id)
|
2010-12-20 19:28:24 +01:00
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
ShowPanel(_panels[id]);
|
2010-12-20 19:28:24 +01:00
|
|
|
}
|
|
|
|
|
2011-09-03 20:40:21 +02:00
|
|
|
void wxUI::OnButtonChangeUser()
|
2010-12-20 19:28:24 +01:00
|
|
|
{
|
|
|
|
ChangeUser();
|
|
|
|
}
|
|
|
|
|
|
|
|
void wxUI::ChangeUser()
|
|
|
|
{
|
2012-04-26 20:45:01 +02:00
|
|
|
try
|
|
|
|
{
|
|
|
|
UsersDialog u(_kiss, this);
|
|
|
|
u.exec();
|
|
|
|
}
|
|
|
|
catch (UsersDialog::ExceptionNewUser e)
|
|
|
|
{
|
|
|
|
}
|
2010-12-20 19:28:24 +01:00
|
|
|
}
|
|
|
|
|
2011-09-03 20:40:21 +02:00
|
|
|
void wxUI::OnButtonAbout()
|
2010-12-20 19:28:24 +01:00
|
|
|
{
|
2017-02-04 15:12:40 +01:00
|
|
|
QMessageBox::information(0, "KissCount " APP_VERSION, _("Personal accounting software") + "\n\nhttp://indefero.soutade.fr/p/kisscount/\n\n" + _("Licenced under GNU GPL v3") + "\n\nCopyright (C) 2010-2017 Grégory Soutadé");
|
2010-12-20 19:28:24 +01:00
|
|
|
}
|
|
|
|
|
2011-09-03 20:40:21 +02:00
|
|
|
void wxUI::OnButtonQuit()
|
2010-12-20 19:28:24 +01:00
|
|
|
{
|
2011-09-04 11:21:30 +02:00
|
|
|
if (QMessageBox::question(0, "KissCount", _("Quit KissCount ?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
|
2011-09-03 20:40:21 +02:00
|
|
|
close();
|
2010-12-20 19:28:24 +01:00
|
|
|
}
|
|
|
|
|
2010-06-23 19:32:42 +02:00
|
|
|
void wxUI::GenerateMonth(int month, int year)
|
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
(dynamic_cast<AccountPanel*>(_panels[0]))->GenerateMonth(month, year);
|
2010-06-23 19:32:42 +02:00
|
|
|
}
|
2010-06-27 21:39:49 +02:00
|
|
|
|
2011-11-01 18:01:17 +01:00
|
|
|
void wxUI::UpdateStats()
|
|
|
|
{
|
|
|
|
if (_curPanel == _panels[0])
|
|
|
|
(dynamic_cast<AccountPanel*>(_panels[0]))->UpdateStats();
|
2010-06-23 19:32:42 +02:00
|
|
|
}
|
2010-06-27 21:39:49 +02:00
|
|
|
|
|
|
|
void wxUI::KillMe()
|
|
|
|
{
|
2010-12-20 19:28:24 +01:00
|
|
|
std::vector<KissPanel*>::iterator it;
|
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
if (_curPanel)
|
2010-06-27 21:39:49 +02:00
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
_vbox->removeWidget(_curPanel);
|
|
|
|
_curPanel = 0;
|
2010-06-27 21:39:49 +02:00
|
|
|
}
|
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
for (it=_panels.begin(); it!= _panels.end(); it++)
|
|
|
|
{
|
2011-09-04 19:25:53 +02:00
|
|
|
if (*it)
|
|
|
|
{
|
2012-04-26 20:59:01 +02:00
|
|
|
_buttonsBox->removeWidget(*_buttons.begin());
|
2011-09-04 19:25:53 +02:00
|
|
|
delete *it;
|
2012-04-26 20:59:01 +02:00
|
|
|
delete *_buttons.begin();
|
2011-09-04 19:25:53 +02:00
|
|
|
}
|
|
|
|
_buttons.erase(_buttons.begin());
|
2010-12-20 19:28:24 +01:00
|
|
|
}
|
2010-07-14 11:15:48 +02:00
|
|
|
|
2010-12-20 19:28:24 +01:00
|
|
|
_panels.clear();
|
2010-06-27 21:39:49 +02:00
|
|
|
}
|
|
|
|
|
2017-10-29 18:21:54 +01:00
|
|
|
void wxUI::NeedReload(KissPanel* panel)
|
2010-06-27 21:39:49 +02:00
|
|
|
{
|
2017-10-29 18:21:54 +01:00
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
// Reload all panels
|
|
|
|
_needReload = -1;
|
|
|
|
|
|
|
|
if (panel)
|
|
|
|
{
|
|
|
|
for(i=0; i<_panels.size(); i++)
|
|
|
|
{
|
|
|
|
if (panel == _panels[i])
|
|
|
|
{
|
|
|
|
_needReload = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-06-27 21:39:49 +02:00
|
|
|
}
|
2012-03-27 21:12:55 +02:00
|
|
|
|
2018-03-11 15:57:22 +01:00
|
|
|
QString wxUI::GetDateLocalFormat()
|
2012-03-27 21:12:55 +02:00
|
|
|
{
|
|
|
|
return _curLanguage.dateFormat;
|
|
|
|
}
|