diff -Nru chinese-calendar-0.7.8/calendar.ui chinese-calendar-0.7.8/calendar.ui
--- chinese-calendar-0.7.8/calendar.ui 2013-06-19 08:01:27.000000000 +0000
+++ chinese-calendar-0.7.8/calendar.ui 2013-07-31 15:44:23.000000000 +0000
@@ -188,16 +188,11 @@
400
- 45
+ 40
110
20
-
-
- 12
-
-
@@ -1352,7 +1347,7 @@
-
+ TextLabel
Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
diff -Nru chinese-calendar-0.7.8/chinese-calendar.pro chinese-calendar-0.7.8/chinese-calendar.pro
--- chinese-calendar-0.7.8/chinese-calendar.pro 2013-06-17 03:50:45.000000000 +0000
+++ chinese-calendar-0.7.8/chinese-calendar.pro 2013-07-31 15:44:23.000000000 +0000
@@ -11,12 +11,34 @@
inst2.path = /usr/share/applications
inst3.files += chinese-calendar.desktop
inst3.path = /etc/xdg/autostart
+default_skin.files += skin/default/chinesecalendarBGyellow.png \
+ skin/default/no.png \
+ skin/default/note.png \
+ skin/default/ok.png
+default_skin.path = /usr/share/chinese-calendar/skin/default
+black_skin.files += skin/black/chinesecalendar.png \
+ skin/black/no.png \
+ skin/black/no-hover.png \
+ skin/black/ok.png \
+ skin/black/ok-hover.png \
+ skin/black/note.png \
+ skin/black/arrow-left.png \
+ skin/black/arrow-right.png \
+ skin/black/arrow-down.png
+black_skin.path = /usr/share/chinese-calendar/skin/black
+qss.files += skin/default-skin.qss \
+ skin/black-skin.qss
+qss.path = /usr/share/chinese-calendar/skin
+
target.source += $$TARGET
target.path = /usr/bin
INSTALLS += inst \
inst1 \
inst2 \
inst3 \
+ default_skin \
+ black_skin \
+ qss \
target
diff -Nru chinese-calendar-0.7.8/chinese-calendar.qrc chinese-calendar-0.7.8/chinese-calendar.qrc
--- chinese-calendar-0.7.8/chinese-calendar.qrc 2013-06-19 07:38:41.000000000 +0000
+++ chinese-calendar-0.7.8/chinese-calendar.qrc 2013-07-31 15:44:23.000000000 +0000
@@ -2,14 +2,9 @@
img/chinesecalendar.svg
img/chinesecalendar-64.png
- img/chinesecalendarBGyellow.png
img/icon.png
img/icon-64.png
translate/i18_zh_CN.qm
translate/i18_zh_CN.ts
- img/no.png
- img/note.png
- img/ok.png
- img/chinesecalendarBGblue.png
diff -Nru chinese-calendar-0.7.8/chinesecalendar.cpp chinese-calendar-0.7.8/chinesecalendar.cpp
--- chinese-calendar-0.7.8/chinesecalendar.cpp 2013-06-19 09:00:00.000000000 +0000
+++ chinese-calendar-0.7.8/chinesecalendar.cpp 2013-07-31 15:44:23.000000000 +0000
@@ -26,9 +26,8 @@
ChineseCalendar::ChineseCalendar(QWidget *parent)
: QWidget(parent)
{
- setupUi(this);
-
- bg = new QPixmap(":/img/chinesecalendarBGblue.png");
+ setupUi(this); m_strFileList.clear();
+// bg = new QPixmap(":/img/chinesecalendarBGyellow.png");
icon = QIcon(":/img/icon.png");
icon64 = QIcon(":/img/chinesecalendar-64.png");
mycalendat=new CCBO;
@@ -41,16 +40,15 @@
connect(YearSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(setYear(int)));
connect(this->backtotoday, SIGNAL(clicked()), this, SLOT(backtoday()));
-
- this->TbnextMonth->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
- this->TbnextYear->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
- this->TbpreviousMonth->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
- this->TbpreviousYear->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
- this->backtotoday->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
- this->YearSelect->setStyleSheet("QComboBox{border: 2px solid lightgray;border-radius: 5px;font:12pt;}");
- this->monthCombo->setStyleSheet("QComboBox{border: 2px solid lightgray;border-radius: 5px;font:12pt;}");
- this->label->setStyleSheet("QLabel{font:12pt;}");
- this->label_2->setStyleSheet("QLabel{font:12pt;}");
+// this->TbnextMonth->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
+// this->TbnextYear->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
+// this->TbpreviousMonth->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
+// this->TbpreviousYear->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
+// this->backtotoday->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}");
+// this->YearSelect->setStyleSheet("QComboBox{border: 2px solid lightgray;border-radius: 5px;font:12pt;}");
+// this->monthCombo->setStyleSheet("QComboBox{border: 2px solid lightgray;border-radius: 5px;font:12pt;}");
+// this->label->setStyleSheet("QLabel{font:12pt;}");
+// this->label_2->setStyleSheet("QLabel{font:12pt;}");
QDateTime dateTime;
QString currentTime;
@@ -167,18 +165,14 @@
pa.setColor(QPalette::WindowText,Qt::black);
this->label_18->setPalette(pa);
+ this->label_19->setPalette(pa);
- pa.setColor(QPalette::WindowText,QColor(235,74,20));
+ pa.setColor(QPalette::WindowText,Qt::red);
this->label_10->setPalette(pa);
+ this->label_11->setPalette(pa);
this->label_12->setPalette(pa);
this->label_13->setPalette(pa);
this->label_14->setPalette(pa);
-
- pa.setColor(QPalette::WindowText,Qt::white);
- this->label_19->setPalette(pa);
-
- pa.setColor(QPalette::WindowText,Qt::red);
- this->label_11->setPalette(pa);
this->label_17->setPalette(pa);
map = new QMap();
@@ -500,6 +494,37 @@
this->actionStaysNormal->setChecked(true);
connect(actionStaysNormal, SIGNAL(triggered()), this, SLOT(setMode()));
+ // default skin
+ this->actionDefault = new QAction(tr("Default"), this);
+ actionDefault->setCheckable(true);
+ actionDefault->setChecked(true);
+ connect(actionDefault, SIGNAL(triggered()), this, SLOT(slotChangeSkin()));
+
+ // black skin
+ this->actionSkin = new QAction(tr("Black"), this);
+ actionSkin->setCheckable(true);
+ connect(actionSkin, SIGNAL(triggered()), this, SLOT(slotChangeSkin()));
+
+ this->skinMenu = new QMenu(tr("换肤"), this);
+ this->skinMenu->addAction(actionDefault);
+ this->skinMenu->addAction(actionSkin);
+
+ QActionGroup *actSkinGrp = new QActionGroup(this);
+ actSkinGrp->addAction(actionDefault);
+ actSkinGrp->addAction(actionSkin);
+
+ // read user customizated skin files
+ readSkinFiles();
+
+ foreach (QString strSkin, m_strFileList)
+ {
+ QAction *actionNew = new QAction(strSkin, this);
+ actionNew->setCheckable(true);
+ actSkinGrp->addAction(actionNew);
+ this->skinMenu->addAction(actionNew);
+ connect(actionNew, SIGNAL(triggered()), this, SLOT(slotChangeSkin()));
+ }
+
this->ag = new QActionGroup(this);
this->ag->addAction(actionStaysOnTop);
this->ag->addAction(actionStaysOnBottom);
@@ -515,19 +540,23 @@
this->trayMenu->addAction(actionStaysOnBottom);
this->trayMenu->addAction(actionStaysNormal);
this->trayMenu->addSeparator();
+ this->trayMenu->addMenu(skinMenu);
+ this->trayMenu->addSeparator();
this->trayMenu->addAction(actionQuit);
this->trayIcon = new QSystemTrayIcon(this);
this->trayIcon->setIcon(icon);
this->trayIcon->setContextMenu(trayMenu);
- connect(this->trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(handle_trayIcon_activated(QSystemTrayIcon::ActivationReason)));
this->trayIcon->show();
}
void ChineseCalendar::paintEvent(QPaintEvent *)
{
+ QStyleOption opt;
+ opt.init(this);
QPainter painter(this);
- painter.drawPixmap(0,0,width(),height(),*bg);
+// painter.drawPixmap(0,0,width(),height(),*bg);
+ style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
// painter.setPen(Qt::gray);
painter.setPen(QColor(255,121,3,100));
@@ -1151,18 +1180,6 @@
YearSelect->setCurrentIndex(YearSelect->currentIndex()+1);
}
-void ChineseCalendar::handle_trayIcon_activated(QSystemTrayIcon::ActivationReason reason)
-{
- switch(reason)
- {
- case QSystemTrayIcon::Trigger:
- this->showOrHide();
- break;
- default:
- ;
- }
-}
-
void ChineseCalendar::showOrHide()
{
if(this->isHidden())
@@ -1188,3 +1205,61 @@
this->show();
}
}
+
+void ChineseCalendar::slotChangeSkin()
+{
+ QAction *action = qobject_cast(sender());
+ QString strSkin = action->text();
+
+ if (!strSkin.isEmpty())
+ {
+ if (strSkin.toLower() == "default" || strSkin.toLower() == "black")
+ {
+ changeSkin(strSkin.toLower());
+ }
+ else
+ {
+ changeSkin(strSkin, false);
+ }
+ }
+}
+
+void ChineseCalendar::changeSkin(const QString &skin, bool bFlag)
+{
+ QString strFilename("");
+
+ if (bFlag)
+ {
+#ifdef DEBUG
+ strFilename = QCoreApplication::applicationDirPath() + QString("/skin/%1-skin.qss").arg(skin);
+#else
+ strFilename = QString("/usr/share/chinese-calendar/skin/%1-skin.qss").arg(skin);
+#endif
+ }
+ else
+ {
+ strFilename = QDir::homePath() + QString("/.local/share/chinese-calendar/skins/%1.qss").arg(skin);
+ }
+
+ QFile qss(strFilename);
+ if (qss.open(QFile::ReadOnly))
+ {
+ qApp->setStyleSheet(qss.readAll());
+ qss.close();
+ }
+}
+
+void ChineseCalendar::readSkinFiles()
+{
+ QString systemdirectory;
+ systemdirectory = QDir::homePath() + "/.local/share/chinese-calendar/skins/";
+
+ QDir dir(systemdirectory);
+ foreach(QFileInfo info, dir.entryInfoList())
+ {
+ if (info.isFile() && info.suffix() == "qss")
+ {
+ m_strFileList << info.baseName();
+ }
+ }
+}
diff -Nru chinese-calendar-0.7.8/chinesecalendar.h chinese-calendar-0.7.8/chinesecalendar.h
--- chinese-calendar-0.7.8/chinesecalendar.h 2013-06-17 03:52:36.000000000 +0000
+++ chinese-calendar-0.7.8/chinesecalendar.h 2013-07-31 15:44:23.000000000 +0000
@@ -74,6 +74,9 @@
QMenu *trayMenu;
QActionGroup *ag;
QAction *actionShow, *actionStaysOnTop, *actionStaysOnBottom, *actionStaysNormal, *actionQuit;
+ QAction *actionDefault;
+ QAction *actionSkin;
+ QMenu *skinMenu;
public slots:
void setMonth(int month);
@@ -81,7 +84,6 @@
void setTime();
void resetcalendardate(QString);
void backtoday();
- void handle_trayIcon_activated(QSystemTrayIcon::ActivationReason reason);
void showOrHide();
void setMode();
void savedata(QString);
@@ -98,6 +100,12 @@
void on_TbnextMonth_clicked();
void on_TbpreviousMonth_clicked();
void on_TbpreviousYear_clicked();
+ void slotChangeSkin();
+private:
+ void changeSkin(const QString &, bool bFlag = true);
+ void readSkinFiles();
+
+ QStringList m_strFileList;
};
#endif
diff -Nru chinese-calendar-0.7.8/cnote.cpp chinese-calendar-0.7.8/cnote.cpp
--- chinese-calendar-0.7.8/cnote.cpp 2013-06-17 03:50:45.000000000 +0000
+++ chinese-calendar-0.7.8/cnote.cpp 2013-07-31 15:44:23.000000000 +0000
@@ -7,13 +7,13 @@
{
setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground);
- pix.load(":/img/note.png",0,Qt::AvoidDither|Qt::ThresholdDither|Qt::ThresholdAlphaDither);
+ //pix.load(":/img/note.png",0,Qt::AvoidDither|Qt::ThresholdDither|Qt::ThresholdAlphaDither);
resize(224,280);
- textedit = new QTextEdit(this);
- ok = new QPushButton(this);
- cancel = new QPushButton(this);
- datelabel = new QLabel(this);
- clearplan = new QPushButton(this);
+ textedit = new QTextEdit(this); textedit->setObjectName("textedit");
+ ok = new QPushButton(this); ok->setObjectName("ok");
+ cancel = new QPushButton(this);cancel->setObjectName("cancel");
+ datelabel = new QLabel(this);datelabel->setObjectName("datelabel");
+ clearplan = new QPushButton(this);clearplan->setObjectName("clearplan");
textedit->resize(155,140);
textedit->move(30,60);
ok->resize(30,30);
@@ -26,13 +26,13 @@
datelabel->resize(120,20);
datelabel->move(50,40);
- ok->setStyleSheet("QPushButton{background-color:transparent;}");
- cancel->setStyleSheet("QPushButton{background-color:transparent;border:0 solid}");
- datelabel->setStyleSheet("QLabel{background-color:transparent;border:0 solid;}");
- clearplan->setStyleSheet("QPushButton{background-color:transparent;}");
- ok->setIcon(QIcon(":/img/ok.png"));
- cancel->setIcon(QIcon(":/img/no.png"));
- textedit->setStyleSheet("QTextEdit{background-color:transparent;border:0 solid;}");
+ //ok->setStyleSheet("QPushButton{background-color:transparent;}");
+ //cancel->setStyleSheet("QPushButton{background-color:transparent;border:0 solid}");
+ //datelabel->setStyleSheet("QLabel{background-color:transparent;border:0 solid;}");
+ //clearplan->setStyleSheet("QPushButton{background-color:transparent;}");
+ //ok->setIcon(QIcon(":/img/ok.png"));
+ //cancel->setIcon(QIcon(":/img/no.png"));
+ //textedit->setStyleSheet("QTextEdit{background-color:transparent;border:0 solid;}");
connect(this->ok,SIGNAL(clicked()),this,SLOT(savenote()));
connect(this->cancel,SIGNAL(clicked()),this,SLOT(cancelnote()));
connect(this->clearplan,SIGNAL(clicked()),this,SLOT(clean()));
@@ -66,7 +66,10 @@
void Cnote::paintEvent(QPaintEvent *)
{
QPainter painter(this);
- painter.drawPixmap(0,0,pix.scaled(this->size(),Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
+ //painter.drawPixmap(0,0,pix.scaled(this->size(),Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
+ QStyleOption opt;
+ opt.init(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
}
void Cnote::mouseMoveEvent(QMouseEvent *event)
diff -Nru chinese-calendar-0.7.8/dateitem.cpp chinese-calendar-0.7.8/dateitem.cpp
--- chinese-calendar-0.7.8/dateitem.cpp 2013-06-19 08:55:17.000000000 +0000
+++ chinese-calendar-0.7.8/dateitem.cpp 2013-07-31 15:44:23.000000000 +0000
@@ -186,4 +186,10 @@
this->isFocus = true;
}
-
+void DateItem::paintEvent(QPaintEvent *)
+{
+ QPainter painter(this);
+ QStyleOption opt;
+ opt.init(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
+}
diff -Nru chinese-calendar-0.7.8/dateitem.h chinese-calendar-0.7.8/dateitem.h
--- chinese-calendar-0.7.8/dateitem.h 2013-06-17 03:50:45.000000000 +0000
+++ chinese-calendar-0.7.8/dateitem.h 2013-07-31 15:44:23.000000000 +0000
@@ -52,6 +52,7 @@
void resizeItem(int x,int y);
protected:
+ void paintEvent(QPaintEvent *);
bool eventFilter(QObject *o, QEvent *ev);
void enter();
void leave();
diff -Nru chinese-calendar-0.7.8/debian/bzr-builder.manifest chinese-calendar-0.7.8/debian/bzr-builder.manifest
--- chinese-calendar-0.7.8/debian/bzr-builder.manifest 1970-01-01 00:00:00.000000000 +0000
+++ chinese-calendar-0.7.8/debian/bzr-builder.manifest 2013-07-31 15:44:23.000000000 +0000
@@ -0,0 +1,2 @@
+# bzr-builder format 0.3 deb-version {debupstream}-0~33
+lp:~mutse-young/chinese-calendar/trunk revid:yyhoo2.young@gmail.com-20130506144225-y4vlipruzrsvvkb8
diff -Nru chinese-calendar-0.7.8/debian/changelog chinese-calendar-0.7.8/debian/changelog
--- chinese-calendar-0.7.8/debian/changelog 2013-06-26 01:01:43.000000000 +0000
+++ chinese-calendar-0.7.8/debian/changelog 2013-07-31 15:44:23.000000000 +0000
@@ -1,53 +1,13 @@
-chinese-calendar (0.7.8-0ubuntu1) saucy; urgency=low
+chinese-calendar (0.7.8-0~33~precise1) precise; urgency=low
- * New upstream release.
- (LP: #1190936, #1192501, #1160698, #1164859, #1161756, #1155491, #1160800)
- * Drop all patches, which were merged back to upstreap.
+ * Auto build.
- -- Zhengpeng Hou Wed, 26 Jun 2013 08:55:14 +0800
+ -- mutse Wed, 31 Jul 2013 15:44:23 +0000
-chinese-calendar (0.7.6-0ubuntu4) raring; urgency=low
+chinese-calendar (0.7.8-1) raring; urgency=low
- * add 03-save-data-per-user.diff (LP: #1160149)
- * remove debian/postinst, since db will be saved under
- user's home.
+ * add skins changing function code
+ * add default and black skin qss files
- -- Zhengpeng Hou Tue, 26 Mar 2013 22:49:47 +0800
+ -- mutse Wed, 01 May 2013 19:11:07 +0800
-chinese-calendar (0.7.6-0ubuntu3) raring; urgency=low
-
- * add 02-fix-write-permission.diff. (LP: #1159732)
-
- -- Zhengpeng Hou Mon, 25 Mar 2013 20:12:01 +0800
-
-chinese-calendar (0.7.6-0ubuntu2) raring; urgency=low
-
- * Add 01-fix-crash.diff to fix the crash on startup.
-
- -- Zhengpeng Hou Thu, 14 Mar 2013 21:41:07 +0800
-
-chinese-calendar (0.7.6-0ubuntu1) raring; urgency=high
-
- * Fix bug #1154063, bug #1154075, bug #1154079, bug #1154050.
- * Modify note function.
-
- -- abelsaber (Yes,it's true) Wed, 13 Mar 2013 10:12:21 +0800
-
-chinese-calendar (0.7.5) raring; urgency=high
-
- * Fix bug #1124849, bug #1124747, bug #1124831, bug #1131516, bug #1124825, bug #1129925.
- * Add note function.
-
- -- abelsaber (Yes,it's true) Tue, 12 Mar 2013 14:25:51 +0800
-
-chinese-calendar (0.7.4) raring; urgency=low
-
- * Optimize the display of dateitem, add systemtray.
-
- -- abelsaber (Yes,it's true) Tue, 29 Jan 2013 14:33:08 +0800
-
-chinese-calendar (0.6.2-1) raring; urgency=low
-
- * Initial release.
-
- -- abelsaber (Yes,it's true) Tue, 22 Jan 2013 14:10:26 +0800
diff -Nru chinese-calendar-0.7.8/debian/patches/01-fix-crash.diff chinese-calendar-0.7.8/debian/patches/01-fix-crash.diff
--- chinese-calendar-0.7.8/debian/patches/01-fix-crash.diff 2013-03-14 13:40:39.000000000 +0000
+++ chinese-calendar-0.7.8/debian/patches/01-fix-crash.diff 1970-01-01 00:00:00.000000000 +0000
@@ -1,55 +0,0 @@
-Index: chinese-calendar-0.7.6/chinesecalendar.cpp
-===================================================================
---- chinese-calendar-0.7.6.orig/chinesecalendar.cpp 2013-03-13 10:08:45.000000000 +0800
-+++ chinese-calendar-0.7.6/chinesecalendar.cpp 2013-03-14 21:40:34.444225307 +0800
-@@ -152,14 +152,12 @@
- QString cnote=mycalendat->ctcl_displaydata(day.year(),day.month(),day.day(),cnote);
- QString haveplan=QString("今日有行程安排");
- QString noplan=QString("今日无行程安排");
-- QStringList cnotelist=cnote.split(" ");
-- int count=cnotelist.count();
-- QString space=QString("");
-- while(count>0&&(cnotelist.at(count-1)==space))
-+ int num=cnote.count();
-+ while( num > 0 && cnote.at(num-1).isSpace())
- {
-- count--;
-+ num--;
- }
-- if(cnote.isEmpty()||count==0)
-+ if(cnote.isEmpty() || num == 0)
- this->label_19->setText(noplan);
- else
- this->label_19->setText(haveplan);
-@@ -785,14 +783,12 @@
- QString haveplan=QString("今日有行程安排");
- QString noplan=QString("今日无行程安排");
- cnote=mycalendat->ctcl_displaydata(date.year(),date.month(),date.day(),cnote);
-- QStringList cnotelist=cnote.split(" ");
-- QString space=QString("");
-- int count=cnotelist.count();
-- while(count>0&&(cnotelist.at(count-1)==space))
-+ int num=cnote.count();
-+ while( num > 0 && cnote.at(num-1).isSpace())
- {
-- count--;
-+ num--;
- }
-- if(cnote.isEmpty()||count==0)
-+ if(cnote.isEmpty() || num == 0)
- this->label_19->setText(noplan);
- else
- this->label_19->setText(haveplan);
-Index: chinese-calendar-0.7.6/cnote.cpp
-===================================================================
---- chinese-calendar-0.7.6.orig/cnote.cpp 2013-03-13 10:08:45.000000000 +0800
-+++ chinese-calendar-0.7.6/cnote.cpp 2013-03-14 21:40:34.444225307 +0800
-@@ -28,7 +28,7 @@
- datelabel->setEnabled(false);
-
- ok->setStyleSheet("QPushButton{background-color:transparent;}");
-- cancel->setStyleSheet("QPushButton{background-color:transparent;border:0 solid}");
-+ cancel->setStyleSheet("QPushButton{background-color:transparent;}");
- datelabel->setStyleSheet("QLineEdit{background-color:transparent;border:0 solid;}");
- clearplan->setStyleSheet("QPushButton{background-color:transparent;}");
- ok->setIcon(QIcon(":/img/ok.png"));
diff -Nru chinese-calendar-0.7.8/debian/patches/02-fix-write-permission.diff chinese-calendar-0.7.8/debian/patches/02-fix-write-permission.diff
--- chinese-calendar-0.7.8/debian/patches/02-fix-write-permission.diff 2013-03-25 12:05:09.000000000 +0000
+++ chinese-calendar-0.7.8/debian/patches/02-fix-write-permission.diff 1970-01-01 00:00:00.000000000 +0000
@@ -1,100 +0,0 @@
-Index: chinese-calendar-0.7.6/ccbo.cpp
-===================================================================
---- chinese-calendar-0.7.6.orig/ccbo.cpp 2013-03-13 10:08:45.000000000 +0800
-+++ chinese-calendar-0.7.6/ccbo.cpp 2013-03-25 20:04:26.529812299 +0800
-@@ -258,9 +258,10 @@
-
- return lunar_month;
- }
--QString CCBO::ctcl_displaydata(int y, int m, int d,QString data)
-+QString CCBO::ctcl_displaydata(int y, int m, int d)
- {
- QString QueryStr;
-+ QString data;
- QueryStr=QString("select note from cnote where y=%1 and m=%2 and d=%3").arg(y).arg(m).arg(d);
- data=ctcl_common_query("cnote",QueryStr);
- return data;
-Index: chinese-calendar-0.7.6/ccbo.h
-===================================================================
---- chinese-calendar-0.7.6.orig/ccbo.h 2013-03-13 10:08:45.000000000 +0800
-+++ chinese-calendar-0.7.6/ccbo.h 2013-03-25 20:04:26.529812299 +0800
-@@ -78,7 +78,7 @@
- int ctcl_solar_to_lunar(int y,int m,int d,struct CCalendar* ctc);
- bool InitConnection(QString Path);
- int ctcl_savenote(int y,int m, int d ,QString textedit);
-- QString ctcl_displaydata(int y,int m,int d,QString data);
-+ QString ctcl_displaydata(int y,int m,int d);
- private:
- QByteArray lunarstr;
- int maxyear;
-Index: chinese-calendar-0.7.6/chinesecalendar.cpp
-===================================================================
---- chinese-calendar-0.7.6.orig/chinesecalendar.cpp 2013-03-25 19:33:02.000000000 +0800
-+++ chinese-calendar-0.7.6/chinesecalendar.cpp 2013-03-25 20:04:26.529812299 +0800
-@@ -149,7 +149,7 @@
- ji = QString("").append(chinesejilist.at(0)).append("\n");
- this->label_18->setText(ji);
-
-- QString cnote=mycalendat->ctcl_displaydata(day.year(),day.month(),day.day(),cnote);
-+ QString cnote=mycalendat->ctcl_displaydata(day.year(),day.month(),day.day());
- QString haveplan=QString("今日有行程安排");
- QString noplan=QString("今日无行程安排");
- int num=cnote.count();
-@@ -462,7 +462,7 @@
- int today = clickday;
- QString dateplan = QString("%1月%2日计划安排").arg(this->monthCombo->currentText()).arg(day);
- QString data;
-- data=mycalendat->ctcl_displaydata(year,month,today,data);
-+ data=mycalendat->ctcl_displaydata(year,month,today);
- note->textedit->setText(data);
- note->datelabel->setText(dateplan);
- }
-@@ -782,7 +782,7 @@
- QString cnote=QString("");
- QString haveplan=QString("今日有行程安排");
- QString noplan=QString("今日无行程安排");
-- cnote=mycalendat->ctcl_displaydata(date.year(),date.month(),date.day(),cnote);
-+ cnote=mycalendat->ctcl_displaydata(date.year(),date.month(),date.day());
- int num=cnote.count();
- while( num > 0 && cnote.at(num-1).isSpace())
- {
-Index: chinese-calendar-0.7.6/cnote.cpp
-===================================================================
---- chinese-calendar-0.7.6.orig/cnote.cpp 2013-03-25 19:33:02.000000000 +0800
-+++ chinese-calendar-0.7.6/cnote.cpp 2013-03-25 20:04:26.529812299 +0800
-@@ -12,7 +12,7 @@
- textedit = new QTextEdit(this);
- ok = new QPushButton(this);
- cancel = new QPushButton(this);
-- datelabel = new QLineEdit(this);
-+ datelabel = new QLabel(this);
- clearplan = new QPushButton(this);
- textedit->resize(155,140);
- textedit->move(30,60);
-@@ -25,11 +25,10 @@
- clearplan->move(30,210);
- datelabel->resize(120,20);
- datelabel->move(50,40);
-- datelabel->setEnabled(false);
-
- ok->setStyleSheet("QPushButton{background-color:transparent;}");
-- cancel->setStyleSheet("QPushButton{background-color:transparent;}");
-- datelabel->setStyleSheet("QLineEdit{background-color:transparent;border:0 solid;}");
-+ cancel->setStyleSheet("QPushButton{background-color:transparent;border:0 solid}");
-+ datelabel->setStyleSheet("QLabel{background-color:transparent;border:0 solid;}");
- clearplan->setStyleSheet("QPushButton{background-color:transparent;}");
- ok->setIcon(QIcon(":/img/ok.png"));
- cancel->setIcon(QIcon(":/img/no.png"));
-Index: chinese-calendar-0.7.6/cnote.h
-===================================================================
---- chinese-calendar-0.7.6.orig/cnote.h 2013-03-13 10:08:45.000000000 +0800
-+++ chinese-calendar-0.7.6/cnote.h 2013-03-25 20:04:26.533812299 +0800
-@@ -14,7 +14,7 @@
- void paintEvent(QPaintEvent *);
- QPoint dragPos;
- QTextEdit *textedit;
-- QLineEdit *datelabel;
-+ QLabel *datelabel;
- protected:
- void mouseMoveEvent(QMouseEvent *event);
- void mousePressEvent(QMouseEvent *event);
diff -Nru chinese-calendar-0.7.8/debian/patches/03-save-data-per-user.diff chinese-calendar-0.7.8/debian/patches/03-save-data-per-user.diff
--- chinese-calendar-0.7.8/debian/patches/03-save-data-per-user.diff 2013-03-26 14:49:01.000000000 +0000
+++ chinese-calendar-0.7.8/debian/patches/03-save-data-per-user.diff 1970-01-01 00:00:00.000000000 +0000
@@ -1,44 +0,0 @@
-Index: chinese-calendar-0.7.6/ccbo.cpp
-===================================================================
---- chinese-calendar-0.7.6.orig/ccbo.cpp 2013-03-26 22:48:03.000000000 +0800
-+++ chinese-calendar-0.7.6/ccbo.cpp 2013-03-26 22:48:52.638389293 +0800
-@@ -275,7 +275,7 @@
- QString note;
- QString insert;
- QueryStr=QString("select note from cnote where y=%1 and m=%2 and d=%3").arg(y).arg(m).arg(d);
-- note=ctcl_common_query("cnote",QueryStr);
-+ note=ctcl_common_query("cnote",QueryStr);
- if(textedit.isEmpty()&¬e.isEmpty())
- return 0;
- if(note.isEmpty())
-@@ -416,8 +416,29 @@
-
- bool CCBO::InitConnection(QString Path)
- {
-+ QString QueryStr;
-+ QString systempath,systemdirectory;
-+ QStringList environment = QProcess::systemEnvironment();
-+ QString systemuser =environment.filter("USER").at(0).split("=").at(1);
-+ if (systemuser == "root")
-+ {
-+ systempath = QString("/%1/.chinese-calendar/KylinLunar.db").arg(systemuser);
-+ systemdirectory = QString("/%1/.chinese-calendar").arg(systemuser);
-+ }
-+ else
-+ {
-+ systempath = QString("/home/%1/.chinese-calendar/KylinLunar.db").arg(systemuser);
-+ systemdirectory = QString("/home/%1/.chinese-calendar").arg(systemuser);
-+ }
-+ if(!QFile::exists(systempath))
-+ {
-+ QString cmd = QString("mkdir %1 && cp /usr/share/chinese-calendar/db/KylinLunar.db %2").arg(systemdirectory).arg(systemdirectory);
-+ system(cmd.toAscii());
-+ }
-+
- QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
-- db.setDatabaseName("/usr/share/chinese-calendar/db/KylinLunar.db");
-+ db.setDatabaseName(systempath);
-+
- if (!db.open()) {
- return false;
- }
diff -Nru chinese-calendar-0.7.8/debian/patches/series chinese-calendar-0.7.8/debian/patches/series
--- chinese-calendar-0.7.8/debian/patches/series 2013-06-26 01:01:04.000000000 +0000
+++ chinese-calendar-0.7.8/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-#01-fix-crash.diff
-#02-fix-write-permission.diff
-#03-save-data-per-user.diff
diff -Nru chinese-calendar-0.7.8/debian/source/format chinese-calendar-0.7.8/debian/source/format
--- chinese-calendar-0.7.8/debian/source/format 2013-07-31 15:47:14.366523868 +0000
+++ chinese-calendar-0.7.8/debian/source/format 2013-07-31 15:47:14.486466206 +0000
@@ -1 +1 @@
-3.0 (quilt)
+3.0 (native)
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/img/chinesecalendarBGblue.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/img/chinesecalendarBGblue.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/img/chinesecalendarBGyellow.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/img/chinesecalendarBGyellow.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/img/no.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/img/no.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/img/note.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/img/note.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/img/ok.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/img/ok.png differ
diff -Nru chinese-calendar-0.7.8/main.cpp chinese-calendar-0.7.8/main.cpp
--- chinese-calendar-0.7.8/main.cpp 2013-06-17 03:50:45.000000000 +0000
+++ chinese-calendar-0.7.8/main.cpp 2013-07-31 15:44:23.000000000 +0000
@@ -37,6 +37,16 @@
translator.load(":/translate/i18_zh_CN.qm");
app.installTranslator(&translator);
+ // load default skin
+#ifdef DEBUG
+ QFile file(QCoreApplication::applicationDirPath() + "/skin/default-skin.qss");
+#else
+ QFile file("/usr/share/chinese-calendar/skin/default-skin.qss");
+#endif
+ file.open(QFile::ReadOnly);
+ QString stylesheet = QObject::tr(file.readAll());
+ app.setStyleSheet(stylesheet);
+
ChineseCalendar *window = new ChineseCalendar;
app.setWindowIcon(window->icon64);
window->setWindowFlags(Qt::FramelessWindowHint);
diff -Nru chinese-calendar-0.7.8/skin/README.md chinese-calendar-0.7.8/skin/README.md
--- chinese-calendar-0.7.8/skin/README.md 1970-01-01 00:00:00.000000000 +0000
+++ chinese-calendar-0.7.8/skin/README.md 2013-07-31 15:44:23.000000000 +0000
@@ -0,0 +1,27 @@
+皮肤说明文档
+============
+
+目录结构如下:
+
+skin/
+ |
+ |-black/
+ |-black-skin.qss
+ |
+ |-blue/
+ |-blue.qss
+ |
+ |-default/
+ |-default-skin.qss
+
+其中,black-skin.qss default-skin.qss为系统皮肤文件,blue.qss为用户自己定义皮肤文件。
+
+### 用户自定义皮肤
+
+若用户想制作自己的个性皮肤,可参考blue.qss。运行程序前,将自制皮肤文件复制到 ~/.local/share/chinese-calendar/skins 目录(若无此目录,请使用 mkdir -p ~/.local/share/chinese-calendar/skins 来新建)下即可换肤。
+
+### 问题与反馈
+
+mutse(墨汁)
+
+
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/black/bg.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/black/bg.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/black/chinesecalendar.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/black/chinesecalendar.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/black/no.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/black/no.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/black/note.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/black/note.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/black/ok.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/black/ok.png differ
diff -Nru chinese-calendar-0.7.8/skin/black-skin.qss chinese-calendar-0.7.8/skin/black-skin.qss
--- chinese-calendar-0.7.8/skin/black-skin.qss 1970-01-01 00:00:00.000000000 +0000
+++ chinese-calendar-0.7.8/skin/black-skin.qss 2013-07-31 15:44:23.000000000 +0000
@@ -0,0 +1,189 @@
+/*
+ * This file is part of the chinese-calendar project
+ * Copyright (C) 2013 Mutse & UbuntuKylin Members
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ * This project is developed by "UbuntuKylin Members" team,
+ * see
+ * Author: Mutse
+ */
+
+ChineseCalendar{
+ background: url(/usr/share/chinese-calendar/skin/black/chinesecalendar.png);
+}
+
+ChineseCalendar QPushButton#TbnextMonth{
+ background-color:transparent;
+ image: url(/usr/share/chinese-calendar/skin/black/arrow-right.png);
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbnextMonth:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#TbnextYear{
+ background-color:transparent;
+ image: url(/usr/share/chinese-calendar/skin/black/arrow-right.png);
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbnextYear:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#TbpreviousMonth{
+ background-color:transparent;
+ image: url(/usr/share/chinese-calendar/skin/black/arrow-left.png);
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbpreviousMonth:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#TbpreviousYear{
+ background-color:transparent;
+ image: url(/usr/share/chinese-calendar/skin/black/arrow-left.png);
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbpreviousYear:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#backtotoday{
+ background-color:transparent;
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#backtotoday:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QComboBox#YearSelect{
+ border: 2px solid lightgray;
+ border-radius: 5px;
+ font:12pt;
+}
+
+ChineseCalendar QComboBox#monthCombo{
+ border: 2px solid lightgray;
+ border-radius: 5px;
+ font:12pt;
+}
+
+ChineseCalendar QComboBox::down-arrow {
+ image: url(/usr/share/chinese-calendar/skin/black/arrow-down.png);
+ background-color: transparent;
+}
+
+ChineseCalendar QLabel#label{
+ font:12pt;
+}
+
+ChineseCalendar QLabel#label_2{
+ font:12pt;
+}
+
+ChineseCalendar QLabel#label_3, QLabel#label_9{
+ color: rgb(112, 121, 138);
+}
+
+ChineseCalendar QLabel#label_4,
+ QLabel#label_5,
+ QLabel#label_6,
+ QLabel#label_7,
+ QLabel#label_8{
+ color: rgb(248,128,35);
+}
+
+ChineseCalendar QLabel#label_10{
+ color: rgb(248,128,35);
+}
+
+ChineseCalendar QLabel#label_11{
+ color: rgb(238,124,35);
+}
+
+ChineseCalendar QLabel#label_12,
+ QLabel#label_13, QLabel#label_14,
+ QLabel#label_15, QLabel#label_17{
+ color: rgb(112, 121, 138);
+}
+
+ChineseCalendar QLabel#label_16{
+ color: black;
+}
+
+Cnote{
+ background: url(/usr/share/chinese-calendar/skin/black/note.png);
+}
+
+Cnote QPushButton#ok{
+ image: url(/usr/share/chinese-calendar/skin/black/ok.png);
+ background-color:transparent;
+}
+
+Cnote QPushButton#ok:hover{
+ image: url(/usr/share/chinese-calendar/skin/black/ok-hover.png);
+}
+
+Cnote QPushButton#cancel{
+ image: url(/usr/share/chinese-calendar/skin/black/no.png);
+ background-color:transparent;
+
+ border:0 solid;
+}
+
+Cnote QPushButton#cancel:hover{
+ image: url(/usr/share/chinese-calendar/skin/black/no-hover.png);
+}
+
+Cnote QLabel#datelabel{
+ background-color: transparent;
+ color: rgb(133,143,162);
+ border:0 solid;
+}
+
+Cnote QPushButton#clearplan{
+ background-color: transparent;
+ color: rgb(133,143,162);
+}
+
+Cnote QTextEdit#textedit{
+ background-color: transparent;
+ color: rgb(133,143,162);
+ border:0 solid;
+}
+
+DateItem:focus{
+ background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 255), stop:1 rgba(255, 121, 2, 200));
+}
+
+DateItem QWidget:hover{
+ background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 155), stop:1 rgba(255, 121, 2, 100));
+}
+
+DateItem QLabel#label{
+ color:rgb(112,121,138);
+}
+
+DateItem QLabel#labe:pressed{
+ color:rgb(255, 255, 0);
+}
+
+DateItem QLabel#label_2{
+ color:rgb(112, 121, 138);
+}
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/default/chinesecalendarBGyellow.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/default/chinesecalendarBGyellow.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/default/no.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/default/no.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/default/note.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/default/note.png differ
Binary files /tmp/zrPtkpnTP7/chinese-calendar-0.7.8/skin/default/ok.png and /tmp/qE1XgApG23/chinese-calendar-0.7.8/skin/default/ok.png differ
diff -Nru chinese-calendar-0.7.8/skin/default-skin.qss chinese-calendar-0.7.8/skin/default-skin.qss
--- chinese-calendar-0.7.8/skin/default-skin.qss 1970-01-01 00:00:00.000000000 +0000
+++ chinese-calendar-0.7.8/skin/default-skin.qss 2013-07-31 15:44:23.000000000 +0000
@@ -0,0 +1,138 @@
+/*
+ * This file is part of the chinese-calendar project
+ * Copyright (C) 2013 Mutse & UbuntuKylin Members
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ * This project is developed by "UbuntuKylin Members" team,
+ * see
+ * Author: Mutse
+ */
+
+ChineseCalendar{
+ background: url(/usr/share/chinese-calendar/skin/default/chinesecalendarBGyellow.png);
+}
+
+ChineseCalendar QPushButton#TbnextMonth{
+ background-color:transparent;
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbnextMonth:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#TbnextYear{
+ background-color:transparent;
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbnextYear:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#TbpreviousMonth{
+ background-color:transparent;
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbpreviousMonth:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#TbpreviousYear{
+ background-color:transparent;
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#TbpreviousYear:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QPushButton#backtotoday{
+ background-color:transparent;
+ color:rgb(200,200,150);
+}
+
+ChineseCalendar QPushButton#backtotoday:hover{
+ color:rgb(255,255,255);
+}
+
+ChineseCalendar QComboBox#YearSelect{
+ border: 2px solid lightgray;
+ border-radius: 5px;
+ font:12pt;
+}
+
+ChineseCalendar QComboBox#monthCombo{
+ border: 2px solid lightgray;
+ border-radius: 5px;
+ font:12pt;
+}
+
+ChineseCalendar QLabel#label{
+ font:12pt;
+}
+
+ChineseCalendar QLabel#label_2{
+ font:12pt;
+}
+
+Cnote{
+ background: url(/usr/share/chinese-calendar/skin/default/note.png);
+}
+
+Cnote QPushButton#ok{
+ image: url(/usr/share/chinese-calendar/skin/default/ok.png);
+ background-color:transparent;
+}
+
+Cnote QPushButton#cancel{
+ image: url(/usr/share/chinese-calendar/skin/default/no.png);
+ background-color:transparent;
+ border:0 solid;
+}
+
+Cnote QLabel#datelabel{
+ background-color:transparent;
+ border:0 solid;
+}
+
+Cnote QPushButton#clearplan{
+ background-color:transparent;
+}
+
+Cnote QTextEdit#textedit{
+ background-color:transparent;
+ border:0 solid;
+}
+
+DateItem:focus{
+ background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 255), stop:1 rgba(255, 121, 2, 200));
+}
+
+DateItem QWidget:hover{
+ background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 155), stop:1 rgba(255, 121, 2, 100));
+}
+
+DateItem QLabel#label{
+ color:rgb(0,0,255);
+}
+
+DateItem QLabel#labe:pressed{
+ color:rgb(255,0,0);
+}
+
+DateItem QLabel#label_2{
+ color:rgb(0,0,0);
+}