initialized and completed. goodnight.
0 parent commit b0c982b38399c502f22e3c83a55bbeb1ddb3ed84
@TAM (Teppei Tamra) TAM (Teppei Tamra) authored on 30 Mar 2018
Showing 10 changed files
View
74
.gitignore 0 → 100644
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
 
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
 
# qtcreator generated files
*.pro.user*
 
# xemacs temporary files
*.flc
 
# Vim temporary files
.*.swp
 
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
 
# MinGW generated files
*.Debug
*.Release
 
# Python byte code
*.pyc
 
# Binaries
# --------
*.dll
*.exe
 
View
28
README.md 0 → 100644
# dischrome 〜chromeを煽るだけ〜
 
### これはなに
最近LinuxラヴなM社がchromeを起動するとやたらとedgeを推すと言うかchromeディスってくるのでついカッとなって1時間で移植。
 
さあみんなchromeより安全で高速でクールでキュートなブラウザに乗り換えるんだ!。
 
### コンパイル
`$ lrelease dischrome.pro`
してから
`$ qmake`
`$ make`
どうぞ。
 
### 使い方
起動するとトレイに居座るのでchromeを起動してみよう。
 
### 終わり方
トレイアイコンを右クリックして「終了」を選べ。
 
### Linux以外でも使える?
`~/.config/google-chrome/SingletonLock`を定期チェックする仕組みだから無理じゃない?。
 
### で?
誤解するなよ、俺はchrome嫌いじゃないぞ。
 
あとこのプログラムは今後更新しませんそらするわけねえわ。
View
99
dischrome.cpp 0 → 100644
/***
 
The MIT License
 
Copyright (c) 2018 Teppei Tamra (TAM)
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
 
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
 
***/
 
#include "dischrome.h"
#include <QApplication>
#include <QStandardPaths>
#include <QFile>
#include <QImage>
#include <QPixmap>
#include <QIcon>
#include <QTimer>
#include <QDateTime>
#include <QMenu>
 
DisChrome::DisChrome()
{
QImage icon(":/icons/thumbsdown.svg");
setIcon(QIcon(QPixmap::fromImage(icon.scaled(QSize(44,44)))));
now = false;
auto menu = new QMenu();
auto quitaction =new QAction(tr("Quit"),this);
connect(quitaction,&QAction::triggered,[](){
QApplication::quit();
});
menu->addAction(quitaction);
setContextMenu(menu);
check();
}
 
bool DisChrome::findChromeInstance()
{
QFile file(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/google-chrome/");
return file.exists();
}
 
const QString DisChrome::message()
{
int t = QDateTime::currentMSecsSinceEpoch() % 6;
switch (t) {
case 0:
return tr("w3m is faster than chrome.");
break;
case 1:
return tr("lynx is safer than chrome.");
break;
case 2:
return tr("Firefox icon is cute than chrome icon.");
break;
case 3:
return tr("Falkon is more cool for KDE users than chrome.");
break;
case 4:
return tr("wget is more faster and safer than chrome.");
break;
case 5:
return tr("wget is more faster and safer than chrome.");
break;
default:
return "";
break;
}
}
 
void DisChrome::check()
{
if (findChromeInstance()) {
if (!now) {
now = true;
showMessage(tr("Are you still using chrome?"),message());
}
} else {
now = false;
}
QTimer::singleShot(1000,this,&DisChrome::check);
}
View
50
dischrome.h 0 → 100644
/***
 
The MIT License
 
Copyright (c) 2018 Teppei Tamra (TAM)
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
 
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
 
***/
 
#ifndef DISCHROME_H
#define DISCHROME_H
 
#include <QSystemTrayIcon>
 
class DisChrome : public QSystemTrayIcon
{
Q_OBJECT
 
public:
DisChrome();
 
protected:
bool now;
 
protected:
bool findChromeInstance();
const QString message();
void check();
 
};
 
#endif // DISCHROME_H
View
23
dischrome.pro 0 → 100644
QT += core widgets
 
TARGET = dischrome
TEMPLATE = app
 
SOURCES += \
main.cpp \
dischrome.cpp
 
HEADERS += \
dischrome.h
 
RESOURCES += \
dischrome.qrc
 
TRANSLATIONS += \
dischrome_ja.ts
 
DISTFILES += \
dischrome.ts \
dischrome_ja.ts \
README.md
View
9
dischrome.qrc 0 → 100644
<RCC>
<qresource prefix="/icons">
<file>thumbsdown.svg</file>
</qresource>
<qresource prefix="/lang" lang="ja">
<file alias="dischrome.qm">dischrome_ja.qm</file>
</qresource>
</RCC>
View
dischrome.ts 0 → 100644
View
dischrome_ja.ts 0 → 100644
View
main.cpp 0 → 100644
View
thumbsdown.svg 0 → 100644