initial project import from KDevelop

This commit is contained in:
Luca Beltrame 2013-02-17 10:19:02 +01:00
commit c0cf369b92
22 changed files with 983 additions and 0 deletions

10
CMakeLists.txt Normal file
View file

@ -0,0 +1,10 @@
project(danbooru_client)
find_package(KDE4 REQUIRED)
include (KDE4Defaults)
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
#add_subdirectory( doc )
add_subdirectory( src )
add_subdirectory( icons )

44
README Normal file
View file

@ -0,0 +1,44 @@
How To Build This Template
-=-=-=-=-=-=-=-=-=-=-=-=-=
--- On Unix:
cd <project_name_path>
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$KDEDIRS -DCMAKE_BUILD_TYPE=Debug .. <- do not forget the ..
make
make install or su -c 'make install'
where $KDEDIRS points to your KDE installation prefix.
to uninstall the project:
make uninstall or su -c 'make uninstall'
Note: you can use another build path. Then cd in your build dir and:
export KDE_SRC=path_to_your_src
cmake $KDE_SRC -DCMAKE_INSTALL_PREFIX=$KDEDIRS -DCMAKE_BUILD_TYPE=Debug
--- On Windows:
cd <project_name_path>
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=%KDEDIRS% -DCMAKE_BUILD_TYPE=Debug .. <- do not forget the ..
[n]make
[n]make install
where %KDEDIRS% points to your KDE installation prefix.
to uninstall the project:
[n]make uninstall
Note: use nmake if you're building with the Visual Studio compiler, or make
if you're using the minGW compiler
----------------------------
Please send all comments to:
Anne-Marie Mahfouf
annma@kde.org
Last update: July 2009

4
doc/CMakeLists.txt Normal file
View file

@ -0,0 +1,4 @@
########### install files ###############
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR danbooru_client)

13
doc/README.DOC Normal file
View file

@ -0,0 +1,13 @@
How to add a documentation to your project:
* copy a template from kdelibs/kdoctools/ to this directory
- article-template.docbook -> article for a short documentation e.g. for a plugin
- template.docbook -> book template for an application
rename the template to index.docbook
edit the content of index.docbook, never use an unmodified template
if you need help with the docbook format mail to the documentation team (kde-doc-english@kde.org)
* if your documentation is finished, add the doc directory to the CMakeLists.txt in the parent dir
(uncomment the line "#add_subdirectory( doc )"
* to get your documentation into the translation process, mail to the translation team (kde-i18n-doc@kde.org)

1
icons/CMakeLists.txt Normal file
View file

@ -0,0 +1 @@
kde4_install_icons( ${ICON_INSTALL_DIR} )

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
kapp4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

22
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,22 @@
set(danbooru_client_SRCS
danbooru_client.cpp
main.cpp
danbooru_clientview.cpp
)
kde4_add_ui_files(danbooru_client_SRCS danbooru_clientview_base.ui prefs_base.ui)
kde4_add_kcfg_files(danbooru_client_SRCS settings.kcfgc )
kde4_add_executable(danbooru_client ${danbooru_client_SRCS})
target_link_libraries(danbooru_client ${KDE4_KDEUI_LIBS} )
install(TARGETS danbooru_client ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### install files ###############
install( PROGRAMS danbooru_client.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES danbooru_client.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES danbooru_clientui.rc DESTINATION ${DATA_INSTALL_DIR}/danbooru_client )

3
src/Messages.sh Normal file
View file

@ -0,0 +1,3 @@
#! /usr/bin/env bash
$EXTRACTRC `find . -name \*.rc` >> rc.cpp
$XGETTEXT *.cpp -o $podir/danbooru_client.pot

108
src/danbooru_client.cpp Normal file
View file

@ -0,0 +1,108 @@
/***************************************************************************
* Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> *
* *
* This program 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 2 of the License, or *
* (at your option) any later version. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "danbooru_client.h"
#include "danbooru_clientview.h"
#include "settings.h"
#include <QtGui/QDropEvent>
#include <QtGui/QPainter>
#include <QtGui/QPrinter>
#include <KConfigDialog>
#include <KStatusBar>
#include <KAction>
#include <KActionCollection>
#include <KStandardAction>
#include <KLocale>
danbooru_client::danbooru_client()
: KXmlGuiWindow(),
m_view(new danbooru_clientView(this)),
m_printer(0)
{
// accept dnd
setAcceptDrops(true);
// tell the KXmlGuiWindow that this is indeed the main widget
setCentralWidget(m_view);
// then, setup our actions
setupActions();
// add a status bar
statusBar()->show();
// a call to KXmlGuiWindow::setupGUI() populates the GUI
// with actions, using KXMLGUI.
// It also applies the saved mainwindow settings, if any, and ask the
// mainwindow to automatically save settings if changed: window size,
// toolbar position, icon size, etc.
setupGUI();
}
danbooru_client::~danbooru_client()
{
}
void danbooru_client::setupActions()
{
KStandardAction::openNew(this, SLOT(fileNew()), actionCollection());
KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection());
KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
// custom menu and menu item - the slot is in the class danbooru_clientView
KAction *custom = new KAction(KIcon("colorize"), i18n("Swi&tch Colors"), this);
actionCollection()->addAction( QLatin1String("switch_action"), custom );
connect(custom, SIGNAL(triggered(bool)), m_view, SLOT(switchColors()));
}
void danbooru_client::fileNew()
{
// this slot is called whenever the File->New menu is selected,
// the New shortcut is pressed (usually CTRL+N) or the New toolbar
// button is clicked
// create a new window
(new danbooru_client)->show();
}
void danbooru_client::optionsPreferences()
{
// The preference dialog is derived from prefs_base.ui
//
// compare the names of the widgets in the .ui file
// to the names of the variables in the .kcfg file
//avoid to have 2 dialogs shown
if ( KConfigDialog::showDialog( "settings" ) ) {
return;
}
KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self());
QWidget *generalSettingsDlg = new QWidget;
ui_prefs_base.setupUi(generalSettingsDlg);
dialog->addPage(generalSettingsDlg, i18n("General"), "package_setting");
connect(dialog, SIGNAL(settingsChanged(QString)), m_view, SLOT(settingsChanged()));
dialog->setAttribute( Qt::WA_DeleteOnClose );
dialog->show();
}
#include "danbooru_client.moc"

103
src/danbooru_client.desktop Normal file
View file

@ -0,0 +1,103 @@
[Desktop Entry]
Name=danbooru_client
Name[ast]=danbooru_client
Name[bg]=danbooru_client
Name[bs]=danbooru_client
Name[ca]=danbooru_client
Name[ca@valencia]=danbooru_client
Name[cs]=danbooru_client
Name[da]=danbooru_client
Name[de]=danbooru_client
Name[el]=danbooru_client
Name[en_GB]=danbooru_client
Name[eo]=danbooru_client
Name[es]=danbooru_client
Name[et]=danbooru_client
Name[fi]=danbooru_client
Name[fr]=danbooru_client
Name[ga]=danbooru_client
Name[gl]=danbooru_client
Name[hu]=danbooru_client
Name[it]=danbooru_client
Name[ja]=danbooru_client
Name[kk]=danbooru_client
Name[km]=danbooru_client
Name[ko]=danbooru_client
Name[lt]=danbooru_client
Name[lv]=danbooru_client
Name[nb]=danbooru_client
Name[nds]=danbooru_client
Name[nl]=danbooru_client
Name[nn]=danbooru_client
Name[pa]=danbooru_client
Name[pl]=danbooru_client
Name[pt]=danbooru_client
Name[pt_BR]=danbooru_client
Name[ro]=danbooru_client
Name[ru]=danbooru_client
Name[sk]=danbooru_client
Name[sq]=danbooru_client
Name[sr]=danbooru_client
Name[sr@ijekavian]=danbooru_client
Name[sr@ijekavianlatin]=danbooru_client
Name[sr@latin]=danbooru_client
Name[sv]=danbooru_client
Name[tr]=danbooru_client
Name[ug]=danbooru_client
Name[uk]=danbooru_client
Name[x-test]=xxdanbooru_clientxx
Name[zh_CN]=danbooru_client
Name[zh_TW]=danbooru_client
Exec=danbooru_client %i -caption "%c"
Icon=danbooru_client
Type=Application
X-DocPath=danbooru_client/index.html
GenericName=A KDE4 Application
GenericName[ast]=Una aplicación de KDE4
GenericName[bg]=Програма за KDE4
GenericName[bs]=KDE4 aplikacija
GenericName[ca]=Una aplicació del KDE4
GenericName[ca@valencia]=Una aplicació del KDE4
GenericName[cs]=Aplikace prostředí KDE
GenericName[da]=Et KDE4-program
GenericName[de]=Eine KDE-4-Anwendung
GenericName[el]=Μια εφαρμογή KDE4
GenericName[en_GB]=A KDE4 Application
GenericName[es]=Una aplicación de KDE4
GenericName[et]=KDE4 rakendus
GenericName[fi]=KDE4-sovellus
GenericName[fr]=Une application pour KDE4
GenericName[ga]=Feidhmchlár KDE4
GenericName[gl]=Un programa de KDE4
GenericName[hu]=KDE4-alkalmazás
GenericName[it]=Un'applicazione di KDE 4
GenericName[ja]=KDE 4
GenericName[kk]=KDE4 қолданбасы
GenericName[km]= KDE4
GenericName[ko]=KDE4
GenericName[lt]=KDE4 programa
GenericName[lv]=KDE4 lietotne
GenericName[nb]=Et KDE4-program
GenericName[nds]=En KDE4-Programm
GenericName[nl]=Een KDE4-programma
GenericName[nn]=Eit KDE 4-program
GenericName[pa]=KDE4
GenericName[pl]=Program dla KDE4
GenericName[pt]=Uma Aplicação do KDE4
GenericName[pt_BR]=Um aplicativo do KDE4
GenericName[ro]=O aplicație KDE4
GenericName[ru]=Приложение KDE4
GenericName[sk]=KDE4 aplikáca
GenericName[sq]=Një Program KDE 4
GenericName[sr]=КДЕ4 програм
GenericName[sr@ijekavian]=КДЕ4 програм
GenericName[sr@ijekavianlatin]=KDE4 program
GenericName[sr@latin]=KDE4 program
GenericName[sv]=Ett KDE4-program
GenericName[tr]=Bir KDE4 Uygulaması
GenericName[ug]=ك د ئې(KDE) 4 پروگراممىسى
GenericName[uk]=Програма для KDE4
GenericName[x-test]=xxA KDE4 Applicationxx
GenericName[zh_CN]=KDE4
GenericName[zh_TW]=KDE4
Terminal=false

71
src/danbooru_client.h Normal file
View file

@ -0,0 +1,71 @@
/***************************************************************************
* Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> *
* *
* This program 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 2 of the License, or *
* (at your option) any later version. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef DANBOORU_CLIENT_H
#define DANBOORU_CLIENT_H
#include <KXmlGuiWindow>
#include "ui_prefs_base.h"
class danbooru_clientView;
class QPrinter;
class KToggleAction;
class KUrl;
/**
* This class serves as the main window for danbooru_client. It handles the
* menus, toolbars and status bars.
*
* @short Main window class
* @author %{AUTHOR} <%{EMAIL}>
* @version %{VERSION}
*/
class danbooru_client : public KXmlGuiWindow
{
Q_OBJECT
public:
/**
* Default Constructor
*/
danbooru_client();
/**
* Default Destructor
*/
virtual ~danbooru_client();
private slots:
void fileNew();
void optionsPreferences();
private:
void setupActions();
private:
Ui::prefs_base ui_prefs_base ;
danbooru_clientView *m_view;
QPrinter *m_printer;
KToggleAction *m_toolbarAction;
KToggleAction *m_statusbarAction;
};
#endif // _DANBOORU_CLIENT_H_

21
src/danbooru_client.kcfg Normal file
View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="danbooru_clientrc"/>
<group name="Preferences">
<entry name="col_background" type="Color">
<label>color of the background</label>
<default>black</default>
</entry>
<entry name="col_foreground" type="Color">
<label>color of the foreground</label>
<default>yellow</default>
</entry>
<entry name="val_time" type="Int">
<label>size of a ball</label>
<default>2</default>
</entry>
</group>
</kcfg>

8
src/danbooru_clientui.rc Normal file
View file

@ -0,0 +1,8 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="danbooru_client" version="1">
<MenuBar>
<Menu name="move"><text>&amp;Move</text>
<Action name="switch_action" />
</Menu>
</MenuBar>
</kpartgui>

View file

@ -0,0 +1,60 @@
/***************************************************************************
* Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> *
* *
* This program 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 2 of the License, or *
* (at your option) any later version. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "danbooru_clientview.h"
#include "settings.h"
#include <KLocale>
#include <QtGui/QLabel>
danbooru_clientView::danbooru_clientView(QWidget *)
{
ui_danbooru_clientview_base.setupUi(this);
settingsChanged();
setAutoFillBackground(true);
}
danbooru_clientView::~danbooru_clientView()
{
}
void danbooru_clientView::switchColors()
{
// switch the foreground/background colors of the label
QColor color = Settings::col_background();
Settings::setCol_background( Settings::col_foreground() );
Settings::setCol_foreground( color );
settingsChanged();
}
void danbooru_clientView::settingsChanged()
{
QPalette pal;
pal.setColor( QPalette::Window, Settings::col_background());
pal.setColor( QPalette::WindowText, Settings::col_foreground());
ui_danbooru_clientview_base.kcfg_sillyLabel->setPalette( pal );
// i18n : internationalization
ui_danbooru_clientview_base.kcfg_sillyLabel->setText( i18n("This project is %1 days old",Settings::val_time()) );
emit signalChangeStatusbar( i18n("Settings changed") );
}
#include "danbooru_clientview.moc"

73
src/danbooru_clientview.h Normal file
View file

@ -0,0 +1,73 @@
/***************************************************************************
* Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> *
* *
* This program 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 2 of the License, or *
* (at your option) any later version. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef DANBOORU_CLIENTVIEW_H
#define DANBOORU_CLIENTVIEW_H
#include <QtGui/QWidget>
#include "ui_danbooru_clientview_base.h"
class QPainter;
class KUrl;
/**
* This is the main view class for danbooru_client. Most of the non-menu,
* non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
* here.
*
* @short Main view
* @author %{AUTHOR} <%{EMAIL}>
* @version %{VERSION}
*/
class danbooru_clientView : public QWidget, public Ui::danbooru_clientview_base
{
Q_OBJECT
public:
/**
* Default constructor
*/
danbooru_clientView(QWidget *parent);
/**
* Destructor
*/
virtual ~danbooru_clientView();
private:
Ui::danbooru_clientview_base ui_danbooru_clientview_base;
signals:
/**
* Use this signal to change the content of the statusbar
*/
void signalChangeStatusbar(const QString& text);
/**
* Use this signal to change the content of the caption
*/
void signalChangeCaption(const QString& text);
private slots:
void switchColors();
void settingsChanged();
};
#endif // danbooru_clientVIEW_H

View file

@ -0,0 +1,211 @@
<ui version="4.0" >
<class>danbooru_clientview_base</class>
<widget class="QWidget" name="danbooru_clientview_base" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>315</width>
<height>233</height>
</rect>
</property>
<property name="windowTitle" >
<string>kapp4_base</string>
</property>
<property name="autoFillBackground" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>11</number>
</property>
<property name="topMargin" >
<number>11</number>
</property>
<property name="rightMargin" >
<number>11</number>
</property>
<property name="bottomMargin" >
<number>11</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="kcfg_sillyLabel" >
<property name="palette" >
<palette>
<active>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>119</red>
<green>119</green>
<blue>119</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font" >
<font>
<family>Sans Serif</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="autoFillBackground" >
<bool>true</bool>
</property>
<property name="text" >
<string>hello, world</string>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

72
src/main.cpp Normal file
View file

@ -0,0 +1,72 @@
/***************************************************************************
* Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> *
* *
* This program 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 2 of the License, or *
* (at your option) any later version. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "danbooru_client.h"
#include <KDE/KApplication>
#include <KDE/KAboutData>
#include <KDE/KCmdLineArgs>
#include <KDE/KLocale>
static const char description[] =
I18N_NOOP("A KDE 4 Application");
static const char version[] = "%{VERSION}";
int main(int argc, char **argv)
{
KAboutData about("danbooru_client", 0, ki18n("danbooru_client"), version, ki18n(description),
KAboutData::License_GPL, ki18n("(C) %{CURRENT_YEAR} %{AUTHOR}"), KLocalizedString(), 0, "%{EMAIL}");
about.addAuthor( ki18n("%{AUTHOR}"), KLocalizedString(), "%{EMAIL}" );
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
options.add("+[URL]", ki18n( "Document to open" ));
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
danbooru_client *widget = new danbooru_client;
// see if we are starting with session management
if (app.isSessionRestored())
{
RESTORE(danbooru_client);
}
else
{
// no session.. just start up normally
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->count() == 0)
{
//danbooru_client *widget = new danbooru_client;
widget->show();
}
else
{
int i = 0;
for (; i < args->count(); i++)
{
//danbooru_client *widget = new danbooru_client;
widget->show();
}
}
args->clear();
}
return app.exec();
}

153
src/prefs_base.ui Normal file
View file

@ -0,0 +1,153 @@
<ui version="4.0" >
<class>prefs_base</class>
<widget class="QWidget" name="prefs_base" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>282</width>
<height>156</height>
</rect>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="textLabel2_2" >
<property name="text" >
<string>Background color:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="KColorButton" name="kcfg_col_background" >
<property name="toolTip" >
<string>Choose a new background color</string>
</property>
<property name="whatsThis" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the &lt;span style=" font-weight:600;">background&lt;/span> color by clicking here and choose the new &lt;span style=" color:#ff0000;">color&lt;/span> in the &lt;span style=" font-style:italic;">color dialog&lt;/span>.&lt;/p>&lt;/body>&lt;/html></string>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Project age:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="textLabel2" >
<property name="text" >
<string>Foreground color:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="KColorButton" name="kcfg_col_foreground" >
<property name="toolTip" >
<string>Choose a new foreground color</string>
</property>
<property name="whatsThis" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the &lt;span style=" font-weight:600;">foreground&lt;/span> color by clicking here and choose the new &lt;span style=" color:#ff0000;">color&lt;/span> in the &lt;span style=" font-style:italic;">color dialog&lt;/span>.&lt;/p>&lt;/body>&lt;/html></string>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>41</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>41</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<widget class="QSpinBox" name="kcfg_val_time" >
<property name="toolTip" >
<string>Set the project age (in days)</string>
</property>
<property name="whatsThis" >
<string>Change the project age (in days) by choosing a new number of days.</string>
</property>
<property name="minimum" >
<number>1</number>
</property>
<property name="value" >
<number>2</number>
</property>
</widget>
</item>
<item row="2" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>41</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >kcolorbutton.h</include>
</includes>
<resources/>
<connections/>
</ui>

6
src/settings.kcfgc Normal file
View file

@ -0,0 +1,6 @@
# Code generation options for kconfig_compiler
File=danbooru_client.kcfg
ClassName=Settings
Singleton=true
Mutators=col_background,col_foreground
# will create the necessary code for setting those variables