⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 linux的多线程下载工具。基于gtk界面。
💻 C
字号:
/* main.c * * Copyright (C) 2004-2004 Wang Xiaoguang (Chice) <chice_wxg@hotmail.com> * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * Authors: Wang Xiaoguang (Chice) <chice_wxg@hotmail.com> */#ifdef HAVE_CONFIG_H#  include <config.h>#endif#include <gtk/gtk.h>#include "interface.h"#include "support.h"#ifndef PACKAGE_DATA_DIR#	define PACKAGE_DATA_DIR "."#endif#ifndef PACKAGE#	define PACKAGE "."#endif//#include "dld.h"#include "dld_ui.h"#include "../dld_language.h"#include "../dld_ui_callback.h"#include "../dld_taskmgr.h"#include "../dld_taskdir.h"#include "../dld_proxymgr.h"gboolean    keep_window_drop_above (gpointer data){	gdk_window_raise(window_drop->window);	return TRUE;}void check_first_run(){	if(dld_config_read_int(NULL, "firstrun", 1))	{		GList *items = NULL;				gint ret;		INT i;		for(i=0;i<DLD_LANGUAGE_COUNT;i++)		  items = g_list_append(items, g_languages[i]);		  				ret  = quick_choice("Please select a language:", items);		dld_language_set((char *)g_list_nth(items, ret)->data);		g_list_free(items);		items = NULL;				items = g_list_append(items, "KDE");		items = g_list_append(items, "Gnome");		items = g_list_append(items, "others");		ret  = quick_choice(_("Please choose your Desktop Manager:"), items);		switch(ret)		{		  case 0: //KDE			  g_shellprograms.filemanager = string_assign(g_shellprograms.filemanager, "konqueror \"%s\"");			  g_shellprograms.browser = string_assign(g_shellprograms.browser, "mozilla \"%s\"");			  g_shellprograms.ark = string_assign(g_shellprograms.ark, "ark \"%s\"");			  g_shellprograms.terminal = string_assign(g_shellprograms.terminal, "konsole -e %s");		  			  break;		  case 1: //Gnome			  g_shellprograms.filemanager = string_assign(g_shellprograms.filemanager, "nautilus \"%s\"");			  g_shellprograms.browser = string_assign(g_shellprograms.browser, "mozilla \"%s\"");			  g_shellprograms.ark = string_assign(g_shellprograms.ark, "ark \"%s\"");			  g_shellprograms.terminal = string_assign(g_shellprograms.terminal, "gnome-terminal -e %s");			  break;		  case 2: //others			  g_shellprograms.filemanager = string_assign(g_shellprograms.filemanager, "mc \"%s\"");			  g_shellprograms.browser = string_assign(g_shellprograms.browser, "mozilla \"%s\"");			  g_shellprograms.ark = string_assign(g_shellprograms.ark, "ark \"%s\"");			  g_shellprograms.terminal = string_assign(g_shellprograms.terminal, "xterm -e %s");			  quick_message(NULL, "Other Desktop Managers may not be well supported by DLD.\nYou had better change the Shell Programs from DLD Options menu.");			  break;		}		dld_taskmgr_save_shell_programs();		dld_config_write_int(NULL, "firstrun", 0);	}}	intmain (int argc, char *argv[]){  gtk_set_locale ();  gtk_init (&argc, &argv);  os_init();  g_thread_init(NULL);  gdk_threads_init();	  dld_config_init();  dld_language_init();  dld_gtkui_init();      add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");  check_first_run();	  create_window_main();  gtk_widget_show(window_main);	  window_drop = create_window_drop();   gtk_widget_show(window_drop);  g_timeout_add(500, (GSourceFunc)keep_window_drop_above, NULL);    dld_set_ui_callback(dld_gtkui_callback);  dld_taskdir_init();  dld_proxymgr_init();  dld_taskmgr_init();    gtk_main ();    dld_taskmgr_destroy();  dld_proxymgr_destroy();  dld_taskdir_destroy();    dld_gtkui_cleanup();  dld_language_destroy();  dld_config_destroy();  os_cleanup();    //pthread_exit(0);  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -